#! 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:AS01:931:IACT") { field(DESC, "Current") field(INP, "PSC:AS01:MG03:IACT") field(EGU, "A") field(HOPR, "2.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:AS01:931:BACT") info(autosaveFields,"HYST") } record(bi, "BEND:AS01:931:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "PSC:AS01:MG03:STATE NPP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "BEND:AS01:931:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "2.0") field(LOPR, "0.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "2.0") field(LOLO, "0.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:AS01:931:BDELTAS") field(DRVH, "2.0") field(DRVL, "0.0") field(DOL, "BEND:AS01:931: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:AS01:931:ICTRL PP") } # This record is processed by BEND:AS01:931:ICON") # Note: we are not setting alarms here. record(ao, "BEND:AS01:931:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "2.0") field(LOPR, "0.0") field(DRVH, "2.0") field(DRVL, "0.0") field(DOL, "BEND:AS01:931:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "BEND:AS01:931:INOM") { field(DESC, "Nominal Current") field(DOL, "BEND:AS01:931:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "2.0") field(DRVL, "0.0") field(HOPR, "2.0") field(LOPR, "0.0") } record(ao, "BEND:AS01:931:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "2.0") field(LOPR, "0.0") field(DRVH, "2.0") field(DRVL, "0.0") field(MDEL, "-1") field(FLNK, "BEND:AS01:931:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "BEND:AS01:931:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "BEND:AS01:931:ISETPT.OMSL") field(DOL2, "BEND:AS01:931:ICTRL") field(LNK2, "BEND:AS01:931:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "BEND:AS01:931:ISETPT.OMSL") } record(ao, "BEND:AS01:931:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "2.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "2.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "2.0") field(FLNK, "BEND:AS01:931:IMIN") } record(ao, "BEND:AS01:931:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "2.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "2.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "BEND:AS01:931:IRANGE") } record(sel, "BEND:AS01:931:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "2.0") field(LOPR, "0.0") field(PREC, "3") field(NVL, "BEND:AS01:931:BACT.SEVR") field(INPA, "BEND:AS01:931:IACT NPP MS") field(INPB, "BEND:AS01:931:IACTPREVOK NPP MS") field(INPC, "BEND:AS01:931:IACTPREVOK NPP MS") field(INPD, "BEND:AS01:931:IACTPREVOK NPP MS") } record(sub, "BEND:AS01:931:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:AS01:931:IDES") field(INPB, "BEND:AS01:931:ISETPT.DRVH") field(INPC, "BEND:AS01:931:ISETPT.DRVL") field(INPD, "BEND:AS01:931:IDELTAS.I") field(INPE, "BEND:AS01:931:IDELTAS.J") field(INPG, "BEND:AS01:931:STATE") field(INPH, "BEND:AS01:931:HSTA") field(EGU, "A") field(HOPR, "2.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "BEND:AS01:931:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:AS01:931:IDES") field(INPB, "BEND:AS01:931:ISETPT.DRVH") field(INPC, "BEND:AS01:931:ISETPT.DRVL") field(INPD, "BEND:AS01:931:IDELTAS.K") field(INPE, "BEND:AS01:931:IDELTAS.L") field(INPG, "BEND:AS01:931:STATE") field(INPH, "BEND:AS01:931:HSTA") field(EGU, "A") field(HOPR, "2.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "BEND:AS01:931:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "BEND:AS01:931:BLIMITS") field(LNK1, "BEND:AS01:931:IACTLIMITS.F PP") field(DOL2, "BEND:AS01:931:IACTLIMITS.I") field(LNK2, "BEND:AS01:931:IACT.HIGH") field(DOL3, "BEND:AS01:931:IACTLIMITS.J") field(LNK3, "BEND:AS01:931:IACT.LOW") field(DOL4, "BEND:AS01:931:IACTLIMITS.K") field(LNK4, "BEND:AS01:931:IACT.HIHI") field(DOL5, "BEND:AS01:931:IACTLIMITS.L") field(LNK5, "BEND:AS01:931:IACT.LOLO") field(DOL6, "BEND:AS01:931:BLIMITS") field(LNK6, "BEND:AS01:931:IMONLIMITS.F PP") field(DOL7, "BEND:AS01:931:IMONLIMITS.I") field(LNK7, "BEND:AS01:931:IMON.HIGH") field(DOL8, "BEND:AS01:931:IMONLIMITS.J") field(LNK8, "BEND:AS01:931:IMON.LOW") field(DOL9, "BEND:AS01:931:IMONLIMITS.K") field(LNK9, "BEND:AS01:931:IMON.HIHI") field(DOLA, "BEND:AS01:931:IMONLIMITS.L") field(LNKA, "BEND:AS01:931: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:AS01:931:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "BEND:AS01:931:TRIMBTOL") field(INPE, "BEND:AS01:931:CHCKBTOL") field(INPF, "BEND:AS01:931:BDELTAS.K") field(INPG, "BEND:AS01:931:BDELTAS.L") field(INPH, "BEND:AS01:931: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:AS01:931:STDZITOLR") field(INPC, "BEND:AS01:931:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = PSC:AS01: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:AS01:931:STATESETPT") { field(DESC, "PS On/Off") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(OUT, "PSC:AS01: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:AS01:MG03:RESET PP # record(bo, "BEND:AS01:931:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "PSC:AS01:MG03:RESET PP") } record(bo, "BEND:AS01:931:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "PSC:AS01: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:AS01:931: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:AS01:931:TRIMRAMPRATE") field(OUT, "PSC:AS01:MG03:IRAMPRATE PP") field(FLNK, "BEND:AS01:931:STDZDLY") } record(ao, "BEND:AS01:931:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "2.0") field(LOPR, "0.0") field(DRVH, "2.0") field(DRVL, "0.0") field(MDEL, "-1") field(OUT, "PSC:AS01:MG03:ISETPT PP") field(DOL, "BEND:AS01:931: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:AS01:931:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "PSC:AS01:MG03:IMON") field(EGU, "A") field(HOPR, "2.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:AS01:931:BMON") } record(ao, "BEND:AS01:931:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "PSC:AS01: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:AS01:931:IRIPLOK") } record(sub, "BEND:AS01:931:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "BEND:AS01:931:IRIPL.VAL") field(INPB, "BEND:AS01:931: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:AS01:931:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "PSC:AS01: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:AS01:931:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "PSC:AS01:MG03:IGND NPP MS") field(OMSL, "closed_loop") } record(bi, "BEND:AS01:931:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "PSC:AS01:MG03:INTLKSUMY NPP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "BEND:AS01:931: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:AS01:MG03:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "BEND:AS01:931:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "BEND:AS01:931:IACTPREVOK") field(LNK2, "BEND:AS01:931:IDIFF") field(LNK3, "BEND:AS01:931:IADIFF") field(LNK4, "BEND:AS01:931:IRATIO") field(LNK5, "BEND:AS01:931:IDIRECT") field(LNK6, "BEND:AS01:931:IACTPOL_CHECK") } record(calc, "BEND:AS01:931:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "BEND:AS01:931:IDES") field(INPB, "BEND:AS01:931:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "2.0") field(LOPR, "0.0") } record(calc, "BEND:AS01:931:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "BEND:AS01:931:IDIFF") field(PREC, "9") } record(calc, "BEND:AS01:931:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "BEND:AS01:931:IDIFF") field(INPB, "BEND:AS01:931:IDES.DRVH") field(PREC, "9") } record(calcout, "BEND:AS01:931:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "BEND:AS01:931:IMIN") field(INPB, "BEND:AS01:931: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:AS01:931: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:AS01:931:IACT") field(FLNK, "BEND:AS01:931:IACTPOL") } record(bo, "BEND:AS01:931:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "BEND:AS01:931: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:AS01:931:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from BEND:AS01:931:IDELTAS and the\n BEND:AS01:931: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:AS01:931:IACT: \n Get copy of BEND:AS01:931:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"BEND:AS01:931: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:AS01:931:IDES:\n Contains raw value calculated by \nBEND:AS01:931: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:AS01:931:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"BEND:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by BEND:AS01:931:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, BEND:AS01:931:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n BEND:AS01:931: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:AS01:931:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:AS01:931:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:AS01:931:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:AS01:931:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "BEND:AS01:931:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "BEND:AS01:931:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "BEND:AS01:931: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:AS01:931:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "BEND:AS01:931:TRIMTYPE.RVAL") field(INPB, "BEND:AS01:931:CONFIG.RVAL") field(OUT, "BEND:AS01:931:TRIMMAXNUM PP") } record(longout, "BEND:AS01:931: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:AS01:931: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:AS01:931:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "BEND:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "BEND:AS01:931: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:AS01:931: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:AS01:931:IMOVE") field(INPB, "BEND:AS01:931:IACT") field(INPC, "BEND:AS01:931:IRAMPRATE") field(INPD, "1.577") field(INPE, "BEND:AS01:931:TRIMDLYPCT") field(INPF, "BEND:AS01:931:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "BEND:AS01:931:RAMPTIME_LEFT PP") } record(longout, "BEND:AS01:931:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "BEND:AS01:931:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "BEND:AS01:931:RAMPDONE_CALC") } record(calc, "BEND:AS01:931:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "BEND:AS01:931:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "BEND:AS01:931:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "BEND:AS01:931: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:AS01:931:RAMPTIME_LEFT") field(OUT, "BEND:AS01:931:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "BEND:AS01:931:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "BEND:AS01:931:RAMPTIME_LEFT NMS") field(OUT, "BEND:AS01:931:RAMPDONE PP") } record(bo, "BEND:AS01:931:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "BEND:AS01:931:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "BEND:AS01:931: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:AS01:931: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:AS01:931:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "BEND:AS01:931:DEBUG.PROC PP") field(LNK2, "BEND:AS01:931:STDZCYCLENUM.PROC PP") field(LNK3, "BEND:AS01:931:STDZDISABLE.PROC PP") field(LNK4, "BEND:AS01:931: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:AS01:931:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "BEND:AS01:931:STDZIMIN NPP NMS") field(INPB, "BEND:AS01:931:STDZIMAX NPP NMS") field(INPC, "BEND:AS01:931:STDZIFINAL NPP NMS") field(INPD, "BEND:AS01:931:STDZCYCLENUM NPP NMS") field(INPE, "BEND:AS01:931:STDZDIRECT.RVAL NPP NMS") field(INPF, "BEND:AS01:931:STDZDISABLE.RVAL CPP NMS") field(INPG, "BEND:AS01:931: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:AS01:931:STDZWF PP") field(OUTB, "BEND:AS01:931: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:AS01:931:STDZWF") } record(mbbo, "BEND:AS01:931: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:AS01:931: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:AS01:931:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "BEND:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "BEND:AS01:931:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "BEND:AS01:931:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "BEND:AS01:931: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:AS01:931:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "BEND:AS01:931:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "BEND:AS01:931:STDZIMIN") } record(ao, "BEND:AS01:931:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "2.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "BEND:AS01:931:STDZIMAX") } record(ao, "BEND:AS01:931:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "2.0") field(LOPR, "0.0") field(VAL, "2.0") field(FLNK, "BEND:AS01:931:STDZIFINAL") } record(ao, "BEND:AS01:931:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "2.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "BEND:AS01:931: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:AS01:931: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:AS01:931:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "BEND:AS01:931:STDZIMIN CP NMS") field(INPB, "BEND:AS01:931:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "BEND:AS01:931:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "BEND:AS01:931:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "BEND:AS01:931:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "BEND:AS01:931:STDZIMIN CP NMS") field(INPB, "BEND:AS01:931:STDZIMAX CP NMS") field(INPC, "BEND:AS01:931:TRIMRAMPRATE CP NMS") field(INPD, "1.577") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "BEND:AS01:931:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "BEND:AS01:931:TRIMDLYPCT CP MS") field(INPB, "BEND:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "BEND:AS01:931:IDES.HOPR") field(INPB, "BEND:AS01:931:STDZMINIPCT CPP NMS") field(INPC, "BEND:AS01:931:IDES.LOPR") field(PREC, "5") } record(calc, "BEND:AS01:931:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "BEND:AS01:931:IDES.HOPR") field(INPB, "BEND:AS01:931:IDES.LOPR") field(INPC, "BEND:AS01:931:STDZDIRECT.RVAL") field(INPD, "BEND:AS01:931:STDZMINIDELTA") field(INPE, "BEND:AS01:931:IDES") field(PREC, "5") field(FLNK, "BEND:AS01:931: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:AS01:931:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "BEND:AS01:931:IDES.HOPR") field(INPB, "BEND:AS01:931:IDES.LOPR") field(INPC, "BEND:AS01:931:STDZDIRECT.RVAL") field(INPD, "BEND:AS01:931:STDZMINIDELTA") field(INPE, "BEND:AS01:931: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:AS01:931: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:AS01:931:IADJUST.RVAL") field(INPB, "BEND:AS01:931:STDZDIRECT.RVAL") field(INPC, "BEND:AS01:931:STDZOK.RVAL") field(INPD, "BEND:AS01:931:STDZDISABLE.RVAL") field(INPE, "BEND:AS01:931:STATE.RVAL CPP NMS") field(INPF, "BEND:AS01:931:ICTRL.RVAL") field(INPG, "BEND:AS01:931:STATE.SEVR") field(INPH, "BEND:AS01:931:BDELTAS.M") field(INPI, "BEND:AS01:931:IACT.SEVR") field(OUT, "BEND:AS01:931:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "BEND:AS01:931:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "BEND:AS01:931:STDZLOSTTOD.PROC") field(LNK2, "BEND:AS01:931:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "BEND:AS01:931:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "BEND:AS01:931:CHECKPWRDIP_ENABLE") field(INPA, "BEND:AS01:931:IACT CP") field(INPB, "BEND:AS01:931:STDZIACTMAX") field(EGU, "A") field(FLNK, "BEND:AS01:931: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:AS01:931:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "BEND:AS01:931:CHECKPWRDIP_ENABLE") field(INPA, "BEND:AS01:931:STDZIACTMAX") field(INPB, "BEND:AS01:931:IACT") field(INPC, "BEND:AS01:931:IDELTAS.I") field(OUT, "BEND:AS01:931: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:AS01:931:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "BEND:AS01:931:STDZOK.RVAL CP") field(INPB, "BEND:AS01:931:STDZDISABLE.RVAL CP") field(INPC, "BEND:AS01:931: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:AS01:931: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:AS01:931:CALBOK") { field(DESC, "Successful Calibration") field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "PSC:AS01: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:AS01:931:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "BEND:AS01:931:CALBOK") field(INPB, "BEND:AS01:931:CALBDISABLE") field(INPC, "BEND:AS01:931:CALBSLOPE") field(OOPT, "On Change") field(OUT, "BEND:AS01:931: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:AS01:931:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "BEND:AS01:931: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:AS01:931:CALBSLOPE") field(DOL3, "BEND:AS01:931: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:AS01:931:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") field(DOL, "PSC:AS01:MG03:CALBTOD") field(OMSL, "closed_loop") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "BEND:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "BEND:AS01:931: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:AS01:931: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:AS01:931:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "BEND:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931:IACT") field(INPD, "BEND:AS01:931:DACSLOPE") field(INPE, "BEND:AS01:931:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "BEND:AS01:931:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "closed_loop") field(PREC, "6") field(PINI, "YES") } record(ao, "BEND:AS01:931:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "2.0") field(HOPR, "2.0") field(DRVL, "0.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "BEND:AS01:931:CALBIMAX") } record(ao, "BEND:AS01:931:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "2.0") field(HOPR, "2.0") field(LOPR, "0.0") field(DRVL, "0.0") field(EGU, "A") field(VAL, "2.0") field(FLNK, "BEND:AS01:931:CALBSTEPNUM") } record(ao, "BEND:AS01:931:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "2.0") field(LOPR, "0.0") field(VAL, "0") } record(longout, "BEND:AS01:931: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:AS01:931:CALBIDELTA") } record(calc, "BEND:AS01:931:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "BEND:AS01:931:CALBIMAX") field(INPB, "BEND:AS01:931:CALBIMIN") field(INPC, "BEND:AS01:931: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:AS01:931:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "PSC:AS01:MG03:ISETPT.DRVH") field(INPB, "PSC:AS01:MG03:IACT.HOPR") field(INPC, "BEND:AS01:931:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "BEND:AS01:931:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "BEND:AS01:931:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:AS01:931:DACSA") } # Used only for xygraph edm plot record(subArray, "BEND:AS01:931:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:AS01:931: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:AS01:931:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:AS01:931:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "BEND:AS01:931:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:AS01:931: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:AS01:931:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:AS01:931:CALBYSA") } # Used only for xygraph edm plot record(subArray, "BEND:AS01:931:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:AS01:931:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "BEND:AS01:931:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:AS01:931:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "BEND:AS01:931:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "BEND:AS01:931:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "BEND:AS01:931:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "BEND:AS01:931: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:AS01:931:CALBSTEPNUM") field(INPB, "BEND:AS01:931:CALBIACTWF") field(INPC, "BEND:AS01:931: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:AS01:931: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:AS01:931:STDZITOL") field(INPH, "BEND:AS01:931:DACSLOPE") field(INPI, "BEND:AS01:931: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:AS01:931: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:AS01:931:CALBSTEPNUM") field(INPB, "BEND:AS01:931:CALBIACTWF") field(INPC, "BEND:AS01:931:DACWF") field(INPF, "BEND:AS01:931: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:AS01:931CALBOK 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:AS01:931:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "BEND:AS01:931:DEGAUSIMIN.PROC PP") field(OUTB, "BEND:AS01:931:DEGAUSIMAX.PROC PP") field(OUTC, "BEND:AS01:931:DEGAUSTYPE.PROC PP") field(OUTD, "BEND:AS01:931:DEGAUSSTEP.PROC PP") field(OUTE, "BEND:AS01:931:MADNAME.PROC PP") field(OUTF, "BEND:AS01:931:PSTYPE.PROC PP") field(OUTG, "BEND:AS01:931: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:AS01:931:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "BEND:AS01:931:DEGAUSIMIN NPP NMS") field(INPB, "BEND:AS01:931:DEGAUSIMAX NPP NMS") field(INPC, "BEND:AS01:931:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "BEND:AS01:931:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "BEND:AS01:931:PSTYPE NPP NMS") field(INPG, "BEND:AS01:931:DEBUG.RVAL NPP NMS") field(INPH, "BEND:AS01:931: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:AS01:931:DEGAUSWF PP") field(OUTB, "BEND:AS01:931:DEGAUSMSG PP") field(OUTC, "BEND:AS01:931: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:AS01:931:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"BEND:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "2.0") field(LOPR, "-2.0") field(DRVH, "2.0") field(DRVL, "-2.0") field(VAL, "-2.0") } record(ao, "BEND:AS01:931:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "2.0") field(LOPR, "-2.0") field(DRVH, "2.0") field(DRVL, "-2.0") field(VAL, "2.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:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "BEND:AS01:931:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:AS01:931:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:AS01:931:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "BEND:AS01:931:DEGAUS_IMAX") field(INPB, "BEND:AS01:931:ISETPT") field(INPC, "BEND:AS01:931:DEGAUSTYPE.RVAL") field(OUT, "BEND:AS01:931:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "BEND:AS01:931:DEGAUS_IMAX_UPDATE") } record(seq, "BEND:AS01:931:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "BEND:AS01:931:ISETPT") field(LNK1, "BEND:AS01:931:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "BEND:AS01:931:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "2.0") field(LOPR, "-2.0") field(DRVH, "2.0") field(DRVL, "-2.0") field(VAL, "2.0") field(FLNK, "BEND:AS01:931:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "BEND:AS01:931:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "BEND:AS01:931:DEGAUS_IMAX") field(FLNK, "BEND:AS01:931:DEGAUS_IMAXPOL") } record(bo, "BEND:AS01:931:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "BEND:AS01:931:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "BEND:AS01:931: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:AS01:931:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "BEND:AS01:931:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "2.0") field(LOPR, "-2.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "BEND:AS01:931: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:AS01:931:IACT") field(INPB, "BEND:AS01:931:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "BEND:AS01:931:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "BEND:AS01:931:IACTPOL") } record(bo, "BEND:AS01:931: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:AS01:931: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:AS01:931:DEGAUSENABLE CP") field(INPB, "BEND:AS01:931:DEGAUSOK") field(INPC, "BEND:AS01:931:STATE CP") field(INPD, "BEND:AS01:931:STATE.SEVR") field(OUT, "BEND:AS01:931:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "BEND:AS01:931:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "BEND:AS01:931:DEGAUS_STATE_CHECK") field(LNK1, "BEND:AS01:931:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "BEND:AS01:931:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "BEND:AS01:931:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "BEND:AS01:931: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:AS01:931:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "BEND:AS01:931:DEGAUSOK.ZSV") field(LNK2, "BEND:AS01:931: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:AS01:931:STATMSG.FRSV") field(LNK4, "BEND:AS01:931: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:AS01:931:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "BEND:AS01:931:DEGAUSOK.ZSV") field(LNK2, "BEND:AS01:931: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:AS01:931:STATMSG.FRSV") field(LNK4, "BEND:AS01:931: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:AS01:931:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "BEND:AS01:931: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:AS01:931:STATMSG.FRSV") field(LNK3, "BEND:AS01:931: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:AS01:931:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "BEND:AS01:931: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:AS01:931:STATMSG.FRSV PP") field(LNK3, "BEND:AS01:931:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "BEND:AS01:931:FUNC") { field(DESC, "BEND:AS01:931 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:AS01:931:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "BEND:AS01:931:CTRL") { field(DESC, "BEND:AS01:931 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:AS01:931:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "BEND:AS01:931:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "BEND:AS01:931:BUSY") } # Set to FREE on IOC reboot record(bo, "BEND:AS01:931:BUSY") { field(DESC, "BEND:AS01:931 Ctrl Done") field(DOL, "BEND:AS01:931:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "BEND:AS01:931:SELECT") } record(bo, "BEND:AS01:931:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "BEND:AS01:931: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:AS01:931:CTRLSTATE") { field(DESC, "BEND:AS01:931 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:AS01:931:CTRL",20,20,0,0,"BEND:AS01:931:CTRL") #! Field("BEND:AS01:931:CTRL.OUT",16777215,1,"BEND:AS01:931:CTRL.OUT") #! Link("BEND:AS01:931:CTRL.OUT","BEND:AS01:931:SELECTEN.A") #! Field("BEND:AS01:931:CTRL.VAL",16777215,1,"BEND:AS01:931:CTRL.VAL") #! Record("BEND:AS01:931:SELECTEN",321,381,0,0,"BEND:AS01:931:SELECTEN") #! Field("BEND:AS01:931:SELECTEN.A",16777215,0,"BEND:AS01:931:SELECTEN.A") #! Field("BEND:AS01:931:SELECTEN.FLNK",16777215,1,"BEND:AS01:931:SELECTEN.FLNK") #! Link("BEND:AS01:931:SELECTEN.FLNK","BEND:AS01:931:BUSY") #! Field("BEND:AS01:931:SELECTEN.VAL",16777215,1,"BEND:AS01:931:SELECTEN.VAL") #! Record("BEND:AS01:931:BUSY",623,274,0,0,"BEND:AS01:931:BUSY") #! Field("BEND:AS01:931:BUSY.DOL",16777215,0,"BEND:AS01:931:BUSY.DOL") #! Link("BEND:AS01:931:BUSY.DOL","BEND:AS01:931:SELECTEN.VAL") #! Field("BEND:AS01:931:BUSY.FLNK",16777215,1,"BEND:AS01:931:BUSY.FLNK") #! Link("BEND:AS01:931:BUSY.FLNK","BEND:AS01:931:SELECT") #! Record("BEND:AS01:931:SELECT",669,508,0,1,"BEND:AS01:931:SELECT") #! Record("BEND:AS01:931:FUNC",940,120,0,0,"BEND:AS01:931:FUNC") #! Field("BEND:AS01:931:FUNC.OUT",16777215,0,"BEND:AS01:931:FUNC.OUT") #! Link("BEND:AS01:931:FUNC.OUT","BEND:AS01:931:CTRL.VAL") #! Record("BEND:AS01:931:ABORT",193,41,0,0,"BEND:AS01:931:ABORT") #! Record("BEND:AS01:931:CTRLSTATE",369,34,0,0,"BEND:AS01:931: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:AS01:931:SELECT is used for Multi-device selection.\nIt is enabled when associated BEND:AS01:931:CTRL is \"0\" (DONE).\nIt is disabled when associated BEND:AS01:931: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:AS01:931: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:AS01:931:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "BEND:AS01:931:BCTRL.SEVR") field(OUT, "BEND:AS01:931: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:AS01:931:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:AS01:931:BACT") field(INPB, "BEND:AS01:931:POLYCOEF") field(INPC, "BEND:AS01:931:POLYCOEF.A") field(INPD, "BEND:AS01:931:POLYCOEF.B") field(INPE, "BEND:AS01:931:IACT MS") field(INPF, "BEND:AS01:931:BDELTAS PP") field(INPG, "100") field(EGU, "A") field(HOPR, "2.0") field(LOPR, "0.0") field(HIHI, "2.0") 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.0") field(LOW, "0.0") field(FLNK, "BEND:AS01:931: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:AS01:931:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "A") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "BEND:AS01:931:BDES") field(INPB, "BEND:AS01:931:TRIMBTOL") field(INPC, "BEND:AS01:931:TRIMBTOLR") field(INPD, "BEND:AS01:931:CHCKBTOL") field(INPE, "BEND:AS01:931:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "BEND:AS01:931:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "BEND:AS01:931:MPSBTOL") field(INPQ, "BEND:AS01:931:MPSBTOLR") field(FLNK, "BEND:AS01:931:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "BEND:AS01:931:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "BEND:AS01:931:BDES") field(INPB, "BEND:AS01:931:BDELTAS.I") field(INPG, "BEND:AS01:931:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "BEND:AS01:931:BCON.HIGH") field(OUTB, "BEND:AS01:931:BCON.LOW") field(OUTC, "BEND:AS01:931:BCON.HIHI") field(OUTD, "BEND:AS01:931:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "BEND:AS01:931:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "BEND:AS01:931:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "BEND:AS01:931:BDIFF") field(LNK2, "BEND:AS01:931:BADIFF") field(LNK3, "BEND:AS01:931:BRATIO") field(LNK4, "BEND:AS01:931:MPSLIMITS") field(LNK5, "BEND:AS01:931:I2BSTATUS") field(LNK6, "BEND:AS01:931:IACTFO.PROC") } record(calc, "BEND:AS01:931:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "BEND:AS01:931:BDES") field(INPB, "BEND:AS01:931:BACT") field(EGU, "A") field(PREC, "7") } record(calc, "BEND:AS01:931:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "BEND:AS01:931:BDIFF") field(EGU, "A") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "BEND:AS01:931:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "BEND:AS01:931:BDIFF") field(INPB, "BEND:AS01:931:BDES.HOPR") field(EGU, "A") field(PREC, "7") } record(mbbi, "BEND:AS01:931: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:AS01:931:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "BEND:AS01:931:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:AS01:931:BMON") field(INPB, "BEND:AS01:931:POLYCOEF") field(INPC, "BEND:AS01:931:POLYCOEF.A") field(INPD, "BEND:AS01:931:POLYCOEF.B") field(INPE, "BEND:AS01:931:IMON MS") field(INPF, "BEND:AS01:931:BDELTAS.VAL") field(INPG, "100") field(EGU, "A") field(HOPR, "2.0") field(LOPR, "0.0") field(HIHI, "2.0") 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.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=PSC:AS01:MG03:BDES CP record(ao, "BEND:AS01:931:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "2.0") field(DRVL, "0.0") field(HOPR, "2.0") field(LOPR, "0.0") field(PREC, "7") field(EGU, "A") field(MDEL, "-1") field(OMSL, "supervisory") # field(DOL, "") field(OUT, "BEND:AS01:931:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "BEND:AS01:931:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:AS01:931:POLYCOEF") field(INPC, "BEND:AS01:931:POLYCOEF.A") field(INPD, "BEND:AS01:931:POLYCOEF.B") field(PREC, "7") field(EGU, "A") field(HOPR, "2.0") field(LOPR, "0.0") field(MDEL, "-1") field(INPE, "BEND:AS01:931:BDES.DRVH") field(INPF, "BEND:AS01:931:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "BEND:AS01:931:IDES") } record(sub, "BEND:AS01:931:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:AS01:931:POLYCOEF") field(INPC, "BEND:AS01:931:POLYCOEF.A") field(INPD, "BEND:AS01:931:POLYCOEF.B") field(INPE, "BEND:AS01:931:BDES.DRVH") field(INPF, "BEND:AS01:931:BDES.DRVL") field(EGU, "A") field(HOPR, "2.0") field(LOPR, "0.0") field(PREC, "7") field(VAL, "0.0") field(FLNK, "BEND:AS01:931:INOM") } record(sub, "BEND:AS01:931:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:AS01:931:BDES.VAL") field(INPB, "BEND:AS01:931:BDES.DRVH") field(INPC, "BEND:AS01:931:BDES.DRVL") field(INPD, "BEND:AS01:931:BDELTAS.I") field(INPE, "BEND:AS01:931:BDELTAS.J") field(INPG, "BEND:AS01:931:STATE") field(INPH, "BEND:AS01:931:HSTA") field(EGU, "A") field(HOPR, "2.0") field(LOPR, "0.0") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "BEND:AS01:931:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:AS01:931:BDES.VAL") field(INPB, "BEND:AS01:931:BDES.DRVH") field(INPC, "BEND:AS01:931:BDES.DRVL") field(INPD, "BEND:AS01:931:BDELTAS.K") field(INPE, "BEND:AS01:931:BDELTAS.L") field(INPG, "BEND:AS01:931:STATE") field(INPH, "BEND:AS01:931:HSTA") field(EGU, "A") field(HOPR, "2.0") field(LOPR, "0.0") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "BEND:AS01:931:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "BEND:AS01:931:BLIMITS") field(LNK1, "BEND:AS01:931:BACTLIMITS.F PP") field(DOL2, "BEND:AS01:931:BACTLIMITS.I") field(LNK2, "BEND:AS01:931:BACT.HIGH") field(DOL3, "BEND:AS01:931:BACTLIMITS.J") field(LNK3, "BEND:AS01:931:BACT.LOW") field(DOL4, "BEND:AS01:931:BACTLIMITS.K") field(LNK4, "BEND:AS01:931:BACT.HIHI") field(DOL5, "BEND:AS01:931:BACTLIMITS.L") field(LNK5, "BEND:AS01:931:BACT.LOLO") field(DOL6, "BEND:AS01:931:BLIMITS") field(LNK6, "BEND:AS01:931:BMONLIMITS.F PP") field(DOL7, "BEND:AS01:931:BMONLIMITS.I") field(LNK7, "BEND:AS01:931:BMON.HIGH") field(DOL8, "BEND:AS01:931:BMONLIMITS.J") field(LNK8, "BEND:AS01:931:BMON.LOW") field(DOL9, "BEND:AS01:931:BMONLIMITS.K") field(LNK9, "BEND:AS01:931:BMON.HIHI") field(DOLA, "BEND:AS01:931:BMONLIMITS.L") field(LNKA, "BEND:AS01:931:BMON.LOLO") field(FLNK, "BEND:AS01:931:ILIMITS") field(SCAN, "5 second") } record(ao, "BEND:AS01:931:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "A") field(DRVH, "2.0") field(DRVL, "0.0") field(HOPR, "2.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, "BEND:AS01:931: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:AS01:931:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "BEND:AS01:931:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "BEND:AS01:931:BCTRL.VAL") field(LNK2, "BEND:AS01:931:BDES PP") field(DOL3, "1") field(LNK3, "BEND:AS01:931:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "BEND:AS01:931:CHECKSTDZLOST.PROC PP") field(DOL5, "BEND:AS01:931:BCTRL.VAL") field(LNK5, "BEND:AS01:931:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "BEND:AS01:931:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "BEND:AS01:931:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:AS01:931:POLYCOEF") field(INPC, "BEND:AS01:931:POLYCOEF.A") field(INPD, "BEND:AS01:931:POLYCOEF.B") field(INPE, "BEND:AS01:931:BDES.DRVH") field(INPF, "BEND:AS01:931:BDES.DRVL") field(PREC, "7") field(EGU, "A") field(HOPR, "2.0") field(LOPR, "0.0") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "BEND:AS01:931:ISETPT") } record(ao, "BEND:AS01:931:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "2.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "2.0") field(LOPR, "0.0") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "BEND:AS01:931:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "BXSS") } record(ai, "BEND:AS01:931: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, "2033.731") } record(ao, "BEND:AS01:931:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "2.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "2.0") field(LOPR, "0.0") field(PREC, "7") field(PINI, "YES") field(VAL, "2.0") field(FLNK, "BEND:AS01:931:BSTEP") } record(ao, "BEND:AS01:931:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "2.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "2.0") field(LOPR, "0.0") field(PREC, "7") field(PINI, "YES") field(VAL, "0.0") field(FLNK, "BEND:AS01:931:BSTEP") } record(ao, "BEND:AS01:931:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "2.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "2.0") field(LOPR, "0.0") field(PINI, "YES") field(PREC, "7") } # This record is processed by BEND:AS01:931: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:AS01:931:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "A") field(HOPR, "2.0") field(LOPR, "0.0") field(DRVH, "2.0") 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:AS01:931:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "BEND:AS01:931:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:AS01:931:POLYCOEF") field(INPC, "BEND:AS01:931:POLYCOEF.A") field(INPD, "BEND:AS01:931:POLYCOEF.B") field(PREC, "7") field(EGU, "A") field(HOPR, "2.0") field(LOPR, "0.0") field(MDEL, "-1") field(INPE, "BEND:AS01:931:BCON.DRVH") field(INPF, "BEND:AS01:931:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "BEND:AS01:931: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:AS01:931:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "BEND:AS01:931:BMAX") field(INPB, "BEND:AS01:931:BMIN") field(INPC, "BEND:AS01:931:BMIN.SEVR") field(INPD, "BEND:AS01:931:BMAX.SEVR") field(EGU, "A") 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:AS01:931:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "BEND:AS01:931:ONLINE CP") field(OUT, "BEND:AS01:931:BCTRLDISABLEFOUT PP") } record(fanout, "BEND:AS01:931:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "BEND:AS01:931:BCTRLDISABLECALC") field(LNK1, "BEND:AS01:931:BCTRLDISABLE") field(LNK2, "BEND:AS01:931:BCTRLENABLE") } record(stringout, "BEND:AS01:931:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "BEND:AS01:931:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "BEND:AS01:931:BCTRLDISV_UPDATE") } record(stringout, "BEND:AS01:931:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "BEND:AS01:931:BCTRL.ASG") field(VAL, "") field(FLNK, "BEND:AS01:931:BCTRLDISV_UPDATE") } record(calcout, "BEND:AS01:931:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "BEND:AS01:931:ONLINE") field(OUT, "BEND:AS01:931: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:AS01:931:BACT and MON\n are processed via links from \n BEND:AS01:931:IACT (device raw value readback 1)\n and\n BEND:AS01:931: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:AS01:931:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = BEND:AS01:931: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:AS01:931:BDES\n is processed when set by CA users or \n BEND:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931:B*LIMITS and BEND:AS01:931:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from BEND:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "A") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "BEND:AS01:931:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "BEND:AS01:931:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "A") field(PREC, "7") field(DRVH, "2.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "2.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:AS01:931:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "A") field(PREC, "7") field(DRVH, "2.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:AS01:931:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "A") field(PREC, "7") field(DRVH, "2.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:AS01:931:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "A") field(PREC, "7") field(DRVH, "2.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, "BEND:AS01:931: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:AS01:931:MPSLIMITS.E PP") } record(aSub, "BEND:AS01:931: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:AS01:931:MPS.RVAL") field(INPB, "BEND:AS01:931:BADIFF") field(INPC, "BEND:AS01:931:BDELTAS.N") field(INPD, "BEND:AS01:931:BACT") field(INPE, "BEND:AS01:931:MPSBITMASK.RVAL") field(INPF, "BEND:AS01:931:MPSBLLIM") field(INPG, "BEND:AS01:931:MPSBMIN") field(INPH, "BEND:AS01:931:MPSBMAX") field(INPI, "BEND:AS01:931: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:AS01:931:INTOL.RVAL PP") field(OUTB, "BEND:AS01:931:INTOL_BMIN.RVAL PP") field(OUTC, "BEND:AS01:931:INTOL_BRANGE.RVAL PP") field(OUTD, "BEND:AS01:931: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:AS01:931:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:AS01:931:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:AS01:931:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:AS01:931:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:AS01:931:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:AS01:931:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:AS01:931:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:AS01:931: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:AS01:931:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "BEND:AS01:931:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "BEND:AS01:931:CHCKBTOL") field(INPB, "BEND:AS01:931:POLYCOEF.B") field(PREC, "9") } record(calc, "BEND:AS01:931:TRIMBTOL") { field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "BEND:AS01:931:CHCKBTOL") field(FLNK, "BEND:AS01:931:CHCKITOL") } record(calc, "BEND:AS01:931:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "BEND:AS01:931:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "BEND:AS01:931:BDES.HOPR") field(INPB, "BEND:AS01:931:STABILITY") field(INPC, "BEND:AS01:931:BDES.LOPR") } record(longout, "BEND:AS01:931: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:AS01:931:CHCKBTOL") } record(calc, "BEND:AS01:931:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "A") field(CALC, "ABS(A*B)") field(INPA, "BEND:AS01:931:POLYCOEF.B") field(INPB, "BEND:AS01:931:TRIMBTOL") field(PREC, "9") } record(ai, "BEND:AS01:931: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:AS01:931: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:AS01:931:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "BEND:AS01:931:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "BEND:AS01:931:PAUGO") } record(fanout, "BEND:AS01:931:PAUGO") { field(DESC, "PAU control") field(LNK1, "BEND:AS01:931:PAUSTOP") field(LNK2, "BEND:AS01:931: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:AS01:931:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "BEND:AS01:931: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:AS01:931:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "BEND:AS01:931: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:AS01:931:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "PSC:AS01:MG03:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "BEND:AS01:931: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:AS01:931:PSTYPE.RVAL") field(INPC, "BEND:AS01:931:TURNEDOFF.RVAL") field(INPD, "BEND:AS01:931:CONFIG.RVAL") field(INPE, "BEND:AS01:931:PSCATEGORY.RVAL") field(INPF, "BEND:AS01:931:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "BEND:AS01:931:AUTOCTRL.RVAL") field(INPJ, "BEND:AS01:931:OUTOFSERVICE.RVAL") field(INPL, "BEND:AS01:931:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "BEND:AS01:931:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "BEND:AS01:931:PAU") field(INPP, "BEND:AS01:931:CALBDISABLE.RVAL") field(INPQ, "BEND:AS01:931:PTRBDISABLE.RVAL") field(INPR, "BEND:AS01:931:TRIMDISABLE.RVAL") field(INPS, "BEND:AS01:931:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "BEND:AS01:931:FBCK") field(INPU, "BEND:AS01:931:TRIMTYPE.RVAL") field(INPV, "BEND:AS01:931:STDZDIRECT.RVAL") field(INPW, "BEND:AS01:931:DEGAUSENABLE.RVAL") field(FLNK, "BEND:AS01:931:HSTA") } record(longin, "BEND:AS01:931:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "BEND:AS01:931:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "BEND:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses BEND:AS01:931:FBCK. # This PV should be replaced by BEND:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"BEND:AS01:931:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "BEND:AS01:931:OUTOFSERVICE NPP NMS") field(OUT, "BEND:AS01:931:ONLINE PP") } record(bo, "BEND:AS01:931:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "BEND:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931:TRIMTYPE") } record(stringout, "BEND:AS01:931:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "BEND:AS01:931:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "BEND:AS01:931:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "BEND:AS01:931:STATE.RVAL") field(INPB, "BEND:AS01:931:INTLKSUMY.RVAL") field(OUT, "BEND:AS01:931:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:AS01:931: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:AS01:931:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "BEND:AS01:931:STATE.RVAL") field(INPB, "BEND:AS01:931:INTLKSUMY.RVAL") field(OUT, "BEND:AS01:931:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:AS01:931:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "BEND:AS01:931:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "BEND:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931:TURNEDOFF",3140,1907,0,1,"BEND:AS01:931:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "BEND:AS01:931:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "BEND:AS01:931:BACT.STAT") field(INPB, "BEND:AS01:931:BDES.STAT") field(INPC, "BEND:AS01:931:IRIPL.STAT") field(INPD, "PSC:AS01:MG03:ISETPT.STAT") field(INPE, "PSC:AS01: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:AS01:931:BACT.SEVR") field(INPH, "BEND:AS01:931:BDES.SEVR") field(INPI, "BEND:AS01:931:IRIPL.SEVR") field(INPJ, "PSC:AS01:MG03:ISETPT.SEVR") field(INPK, "PSC:AS01: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:AS01:931:STATE.RVAL") field(INPN, "BEND:AS01:931:STDZOK") field(INPO, "BEND:AS01:931:CALBOK") field(INPP, "BEND:AS01:931:OUTOFSERVICE.RVAL") field(INPQ, "BEND:AS01:931:CONFIG.RVAL") field(INPR, "BEND:AS01:931:HSTA") field(INPS, "BEND:AS01:931:CTRL.RVAL") field(INPT, "BEND:AS01:931:DEGAUSOK") field(INPV, "BEND:AS01:931: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:AS01:931:STAT") } record(longout, "BEND:AS01:931:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "BEND:AS01:931:STATCTRLSUB") field(DOL, "BEND:AS01:931:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "BEND:AS01:931:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "BEND:AS01:931:STAT") field(INPB, "BEND:AS01:931:HSTA") field(INPD, "BEND:AS01:931:ONOFFCTRL.RVAL") field(FLNK, "BEND:AS01:931:STATMSG") } record(mbbo, "BEND:AS01:931: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:AS01:931:UNAVAILGO") field(DOL, "BEND:AS01:931:STATCTRLSUB.W") } record(seq, "BEND:AS01:931:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "BEND:AS01:931:STATSUB.U") field(LNK1, "BEND:AS01:931:UNAVAIL PP") } record(stringout, "BEND:AS01:931:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"BEND:AS01:931:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - BEND:AS01:931:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - BEND:AS01:931: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:AS01:931STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - BEND:AS01:931:STATUS\nC - BEND:AS01:931:ON\nD - BEND:AS01:931:STDZOK\nE - BEND:AS01:931:CALBOK\nF - BEND:AS01:931:BACTDRIFT (future)\nG -\nH- BEND:AS01:931:DACSTATUS\nI -BEND:AS01:931:ADCSTATUS\nJ - BEND:AS01:931:BACTSTATUS\nK - BEND:AS01:931:BDESSTATUS\nL - BEND:AS01:931:RIPLSTATUS\n\nOutput:\nP - BEND:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:AS01:931:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:AS01:931:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:AS01:931:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "BEND:AS01:931:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "BEND:AS01:931:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "BEND:AS01:931: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:AS01:931:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "BEND:AS01:931:TRIMTYPE.RVAL") field(INPB, "BEND:AS01:931:CONFIG.RVAL") field(OUT, "BEND:AS01:931:TRIMMAXNUM PP") } record(longout, "BEND:AS01:931: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:AS01:931: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:AS01:931:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "BEND:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "BEND:AS01:931: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:AS01:931: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:AS01:931:IMOVE") field(INPB, "BEND:AS01:931:IACT") field(INPC, "BEND:AS01:931:IRAMPRATE") field(INPD, "1.577") field(INPE, "BEND:AS01:931:TRIMDLYPCT") field(INPF, "BEND:AS01:931:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "BEND:AS01:931:RAMPTIME_LEFT PP") } record(longout, "BEND:AS01:931:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "BEND:AS01:931:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "BEND:AS01:931:RAMPDONE_CALC") } record(calc, "BEND:AS01:931:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "BEND:AS01:931:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "BEND:AS01:931:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "BEND:AS01:931: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:AS01:931:RAMPTIME_LEFT") field(OUT, "BEND:AS01:931:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "BEND:AS01:931:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "BEND:AS01:931:RAMPTIME_LEFT NMS") field(OUT, "BEND:AS01:931:RAMPDONE PP") } record(bo, "BEND:AS01:931:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "BEND:AS01:931:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "BEND:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931:PSTYPE.RVAL") field(INPC, "BEND:AS01:931:TURNEDOFF.RVAL") field(INPD, "BEND:AS01:931:CONFIG.RVAL") field(INPE, "BEND:AS01:931:PSCATEGORY.RVAL") field(INPF, "BEND:AS01:931:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "BEND:AS01:931:AUTOCTRL.RVAL") field(INPJ, "BEND:AS01:931:OUTOFSERVICE.RVAL") field(INPL, "BEND:AS01:931:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "BEND:AS01:931:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "BEND:AS01:931:PAU") field(INPP, "BEND:AS01:931:CALBDISABLE.RVAL") field(INPQ, "BEND:AS01:931:PTRBDISABLE.RVAL") field(INPR, "BEND:AS01:931:TRIMDISABLE.RVAL") field(INPS, "BEND:AS01:931:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "BEND:AS01:931:FBCK") field(INPU, "BEND:AS01:931:TRIMTYPE.RVAL") field(INPV, "BEND:AS01:931:STDZDIRECT.RVAL") field(INPW, "BEND:AS01:931:DEGAUSENABLE.RVAL") field(FLNK, "BEND:AS01:931:HSTA") } record(longin, "BEND:AS01:931:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "BEND:AS01:931:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "BEND:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses BEND:AS01:931:FBCK. # This PV should be replaced by BEND:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"BEND:AS01:931:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "BEND:AS01:931:OUTOFSERVICE NPP NMS") field(OUT, "BEND:AS01:931:ONLINE PP") } record(bo, "BEND:AS01:931:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "BEND:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931:TRIMTYPE") } record(stringout, "BEND:AS01:931:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "BEND:AS01:931:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "BEND:AS01:931:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "BEND:AS01:931:STATE.RVAL") field(INPB, "BEND:AS01:931:INTLKSUMY.RVAL") field(OUT, "BEND:AS01:931:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:AS01:931: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:AS01:931:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "BEND:AS01:931:STATE.RVAL") field(INPB, "BEND:AS01:931:INTLKSUMY.RVAL") field(OUT, "BEND:AS01:931:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:AS01:931:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "BEND:AS01:931:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "BEND:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931: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:AS01:931:TURNEDOFF",3140,1907,0,1,"BEND:AS01:931: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, "SOLN:AS01:111:IACT") { field(DESC, "Current") field(INP, "MCOR:AS01:101:IACT") field(EGU, "A") field(HOPR, "5.0") field(LOPR, "-5.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "SOLN:AS01:111:BACT") info(autosaveFields,"HYST") } record(bi, "SOLN:AS01:111:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "MCOR:AS01:101:STATE NPP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "SOLN:AS01:111:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "5.0") field(LOPR, "-5.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "5.0") field(LOLO, "-5.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "SOLN:AS01:111:BDELTAS") field(DRVH, "5.0") field(DRVL, "-5.0") field(DOL, "SOLN:AS01:111: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, "SOLN:AS01:111:ICTRL PP") } # This record is processed by SOLN:AS01:111:ICON") # Note: we are not setting alarms here. record(ao, "SOLN:AS01:111:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "5.0") field(LOPR, "-5.0") field(DRVH, "5.0") field(DRVL, "-5.0") field(DOL, "SOLN:AS01:111:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "SOLN:AS01:111:INOM") { field(DESC, "Nominal Current") field(DOL, "SOLN:AS01:111:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "5.0") field(DRVL, "-5.0") field(HOPR, "5.0") field(LOPR, "-5.0") } record(ao, "SOLN:AS01:111:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "5.0") field(LOPR, "-5.0") field(DRVH, "5.0") field(DRVL, "-5.0") field(MDEL, "-1") field(FLNK, "SOLN:AS01:111:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "SOLN:AS01:111:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "SOLN:AS01:111:ISETPT.OMSL") field(DOL2, "SOLN:AS01:111:ICTRL") field(LNK2, "SOLN:AS01:111:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "SOLN:AS01:111:ISETPT.OMSL") } record(ao, "SOLN:AS01:111:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "5.0") field(DRVL, "-5.0") field(EGU, "A") field(HOPR, "5.0") field(LOPR, "-5.0") field(PREC, "3") field(PINI, "YES") field(VAL, "5.0") field(FLNK, "SOLN:AS01:111:IMIN") } record(ao, "SOLN:AS01:111:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "5.0") field(DRVL, "-5.0") field(EGU, "A") field(HOPR, "5.0") field(LOPR, "-5.0") field(PREC, "3") field(VAL, "-5.0") field(FLNK, "SOLN:AS01:111:IRANGE") } record(sel, "SOLN:AS01:111:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "5.0") field(LOPR, "-5.0") field(PREC, "3") field(NVL, "SOLN:AS01:111:BACT.SEVR") field(INPA, "SOLN:AS01:111:IACT NPP MS") field(INPB, "SOLN:AS01:111:IACTPREVOK NPP MS") field(INPC, "SOLN:AS01:111:IACTPREVOK NPP MS") field(INPD, "SOLN:AS01:111:IACTPREVOK NPP MS") } record(sub, "SOLN:AS01:111:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "SOLN:AS01:111:IDES") field(INPB, "SOLN:AS01:111:ISETPT.DRVH") field(INPC, "SOLN:AS01:111:ISETPT.DRVL") field(INPD, "SOLN:AS01:111:IDELTAS.I") field(INPE, "SOLN:AS01:111:IDELTAS.J") field(INPG, "SOLN:AS01:111:STATE") field(INPH, "SOLN:AS01:111:HSTA") field(EGU, "A") field(HOPR, "5.0") field(LOPR, "-5.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "SOLN:AS01:111:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "SOLN:AS01:111:IDES") field(INPB, "SOLN:AS01:111:ISETPT.DRVH") field(INPC, "SOLN:AS01:111:ISETPT.DRVL") field(INPD, "SOLN:AS01:111:IDELTAS.K") field(INPE, "SOLN:AS01:111:IDELTAS.L") field(INPG, "SOLN:AS01:111:STATE") field(INPH, "SOLN:AS01:111:HSTA") field(EGU, "A") field(HOPR, "5.0") field(LOPR, "-5.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "SOLN:AS01:111:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "SOLN:AS01:111:BLIMITS") field(LNK1, "SOLN:AS01:111:IACTLIMITS.F PP") field(DOL2, "SOLN:AS01:111:IACTLIMITS.I") field(LNK2, "SOLN:AS01:111:IACT.HIGH") field(DOL3, "SOLN:AS01:111:IACTLIMITS.J") field(LNK3, "SOLN:AS01:111:IACT.LOW") field(DOL4, "SOLN:AS01:111:IACTLIMITS.K") field(LNK4, "SOLN:AS01:111:IACT.HIHI") field(DOL5, "SOLN:AS01:111:IACTLIMITS.L") field(LNK5, "SOLN:AS01:111:IACT.LOLO") field(DOL6, "SOLN:AS01:111:BLIMITS") field(LNK6, "SOLN:AS01:111:IMONLIMITS.F PP") field(DOL7, "SOLN:AS01:111:IMONLIMITS.I") field(LNK7, "SOLN:AS01:111:IMON.HIGH") field(DOL8, "SOLN:AS01:111:IMONLIMITS.J") field(LNK8, "SOLN:AS01:111:IMON.LOW") field(DOL9, "SOLN:AS01:111:IMONLIMITS.K") field(LNK9, "SOLN:AS01:111:IMON.HIHI") field(DOLA, "SOLN:AS01:111:IMONLIMITS.L") field(LNKA, "SOLN:AS01:111: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, "SOLN:AS01:111:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "SOLN:AS01:111:TRIMBTOL") field(INPE, "SOLN:AS01:111:CHCKBTOL") field(INPF, "SOLN:AS01:111:BDELTAS.K") field(INPG, "SOLN:AS01:111:BDELTAS.L") field(INPH, "SOLN:AS01:111: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, "SOLN:AS01:111:STDZITOLR") field(INPC, "SOLN:AS01:111:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = MCOR:AS01:101: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, "SOLN:AS01:111: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 = MCOR:AS01:101:RESET PP # record(bo, "SOLN:AS01:111:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "MCOR:AS01:101:RESET PP") } record(bo, "SOLN:AS01:111:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "") 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, "SOLN:AS01:111: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, "SOLN:AS01:111:TRIMRAMPRATE") field(OUT, "") field(FLNK, "SOLN:AS01:111:STDZDLY") } record(ao, "SOLN:AS01:111:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "5.0") field(LOPR, "-5.0") field(DRVH, "5.0") field(DRVL, "-5.0") field(MDEL, "-1") field(OUT, "MCOR:AS01:101:ISETPT PP") field(DOL, "SOLN:AS01:111: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, "SOLN:AS01:111:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "") field(EGU, "A") field(HOPR, "5.0") field(LOPR, "-5.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "SOLN:AS01:111:BMON") } record(ao, "SOLN:AS01:111:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "SOLN:AS01:111:IRIPLOK") } record(sub, "SOLN:AS01:111:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "SOLN:AS01:111:IRIPL.VAL") field(INPB, "SOLN:AS01:111: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, "SOLN:AS01:111: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, "SOLN:AS01:111:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") } record(bi, "SOLN:AS01:111:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "MCOR:AS01:101:INTLKSUMY NPP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "SOLN:AS01:111: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, "MCOR:AS01:101:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "SOLN:AS01:111:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "SOLN:AS01:111:IACTPREVOK") field(LNK2, "SOLN:AS01:111:IDIFF") field(LNK3, "SOLN:AS01:111:IADIFF") field(LNK4, "SOLN:AS01:111:IRATIO") field(LNK5, "SOLN:AS01:111:IDIRECT") field(LNK6, "SOLN:AS01:111:IACTPOL_CHECK") } record(calc, "SOLN:AS01:111:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "SOLN:AS01:111:IDES") field(INPB, "SOLN:AS01:111:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "5.0") field(LOPR, "-5.0") } record(calc, "SOLN:AS01:111:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "SOLN:AS01:111:IDIFF") field(PREC, "9") } record(calc, "SOLN:AS01:111:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "SOLN:AS01:111:IDIFF") field(INPB, "SOLN:AS01:111:IDES.DRVH") field(PREC, "9") } record(calcout, "SOLN:AS01:111:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "SOLN:AS01:111:IMIN") field(INPB, "SOLN:AS01:111: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, "SOLN:AS01:111: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, "SOLN:AS01:111:IACT") field(FLNK, "SOLN:AS01:111:IACTPOL") } record(bo, "SOLN:AS01:111:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "SOLN:AS01:111: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,"SOLN:AS01:111:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from SOLN:AS01:111:IDELTAS and the\n SOLN:AS01:111: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,"SOLN:AS01:111:IACT: \n Get copy of SOLN:AS01:111:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"SOLN:AS01:111: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,"SOLN:AS01:111:IDES:\n Contains raw value calculated by \nSOLN:AS01:111: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 \nSOLN:AS01:111:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"SOLN:AS01:111: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 SOLN:AS01:111: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 SOLN:AS01:111: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,"SOLN:AS01:111:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by SOLN:AS01:111:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, SOLN:AS01:111:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n SOLN:AS01:111: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, "SOLN:AS01:111:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "SOLN:AS01:111:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "SOLN:AS01:111:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "SOLN:AS01:111:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "SOLN:AS01:111:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "SOLN:AS01:111:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "0") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "SOLN:AS01:111: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, "SOLN:AS01:111:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "SOLN:AS01:111:TRIMTYPE.RVAL") field(INPB, "SOLN:AS01:111:CONFIG.RVAL") field(OUT, "SOLN:AS01:111:TRIMMAXNUM PP") } record(longout, "SOLN:AS01:111: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, "SOLN:AS01:111: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, "closed_loop") field(VAL, "1") field(OUT, "SOLN:AS01:111:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "SOLN:AS01:111: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, "closed_loop") field(VAL, "10") } record(bo, "SOLN:AS01:111: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, "SOLN:AS01:111: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, "SOLN:AS01:111:TRIMSTEPMIN") { field(DESC, "Min step in current") field(DTYP, "Soft Channel") field(DOL, "MCOR:AS01:101:ISTEP") field(PREC, "7") field(EGUF, "10") field(EGUL, "0") field(EGU, "A") field(HOPR, "10") field(LOPR, "0") field(VAL, "0.0001") } record(bo, "SOLN:AS01:111:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "1") } record(ao, "SOLN:AS01:111: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, "SOLN:AS01:111:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "SOLN:AS01:111: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, "SOLN:AS01:111: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, "SOLN:AS01:111:IMOVE") field(INPB, "SOLN:AS01:111:IACT") field(INPC, "SOLN:AS01:111:IRAMPRATE") field(INPD, "1.0") field(INPE, "SOLN:AS01:111:TRIMDLYPCT") field(INPF, "SOLN:AS01:111:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "SOLN:AS01:111:RAMPTIME_LEFT PP") } record(longout, "SOLN:AS01:111:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "SOLN:AS01:111:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "SOLN:AS01:111:RAMPDONE_CALC") } record(calc, "SOLN:AS01:111:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "SOLN:AS01:111:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "SOLN:AS01:111:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "SOLN:AS01:111: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, "SOLN:AS01:111:RAMPTIME_LEFT") field(OUT, "SOLN:AS01:111:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "SOLN:AS01:111:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "SOLN:AS01:111:RAMPTIME_LEFT NMS") field(OUT, "SOLN:AS01:111:RAMPDONE PP") } record(bo, "SOLN:AS01:111:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "SOLN:AS01:111:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "SOLN:AS01:111: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, "SOLN:AS01:111: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, "SOLN:AS01:111:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "SOLN:AS01:111:DEBUG.PROC PP") field(LNK2, "SOLN:AS01:111:STDZCYCLENUM.PROC PP") field(LNK3, "SOLN:AS01:111:STDZDISABLE.PROC PP") field(LNK4, "SOLN:AS01:111: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, "SOLN:AS01:111:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "SOLN:AS01:111:STDZIMIN NPP NMS") field(INPB, "SOLN:AS01:111:STDZIMAX NPP NMS") field(INPC, "SOLN:AS01:111:STDZIFINAL NPP NMS") field(INPD, "SOLN:AS01:111:STDZCYCLENUM NPP NMS") field(INPE, "SOLN:AS01:111:STDZDIRECT.RVAL NPP NMS") field(INPF, "SOLN:AS01:111:STDZDISABLE.RVAL CPP NMS") field(INPG, "SOLN:AS01:111: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, "SOLN:AS01:111:STDZWF PP") field(OUTB, "SOLN:AS01:111: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, "SOLN:AS01:111:STDZWF") } record(mbbo, "SOLN:AS01:111: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, "SOLN:AS01:111: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, "SOLN:AS01:111:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "SOLN:AS01:111: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, "SOLN:AS01:111: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, "SOLN:AS01:111: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, "SOLN:AS01:111:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "SOLN:AS01:111:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "SOLN:AS01:111:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "SOLN:AS01:111: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, "SOLN:AS01:111:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "SOLN:AS01:111:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "SOLN:AS01:111:STDZIMIN") } record(ao, "SOLN:AS01:111:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "5.0") field(LOPR, "-5.0") field(VAL, "-5.0") field(FLNK, "SOLN:AS01:111:STDZIMAX") } record(ao, "SOLN:AS01:111:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "5.0") field(LOPR, "-5.0") field(VAL, "5.0") field(FLNK, "SOLN:AS01:111:STDZIFINAL") } record(ao, "SOLN:AS01:111:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "5.0") field(LOPR, "-5.0") field(VAL, "-5.0") field(FLNK, "SOLN:AS01:111: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, "SOLN:AS01:111: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, "SOLN:AS01:111:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "SOLN:AS01:111:STDZIMIN CP NMS") field(INPB, "SOLN:AS01:111:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "SOLN:AS01:111:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "SOLN:AS01:111:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "SOLN:AS01:111:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "SOLN:AS01:111:STDZIMIN CP NMS") field(INPB, "SOLN:AS01:111:STDZIMAX CP NMS") field(INPC, "SOLN:AS01:111:TRIMRAMPRATE CP NMS") field(INPD, "1.0") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "SOLN:AS01:111:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "SOLN:AS01:111:TRIMDLYPCT CP MS") field(INPB, "SOLN:AS01:111: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, "SOLN:AS01:111:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "SOLN:AS01:111: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, "SOLN:AS01:111:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "SOLN:AS01:111:IDES.HOPR") field(INPB, "SOLN:AS01:111:STDZMINIPCT CPP NMS") field(INPC, "SOLN:AS01:111:IDES.LOPR") field(PREC, "5") } record(calc, "SOLN:AS01:111:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "SOLN:AS01:111:IDES.HOPR") field(INPB, "SOLN:AS01:111:IDES.LOPR") field(INPC, "SOLN:AS01:111:STDZDIRECT.RVAL") field(INPD, "SOLN:AS01:111:STDZMINIDELTA") field(INPE, "SOLN:AS01:111:IDES") field(PREC, "5") field(FLNK, "SOLN:AS01:111: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, "SOLN:AS01:111:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "SOLN:AS01:111:IDES.HOPR") field(INPB, "SOLN:AS01:111:IDES.LOPR") field(INPC, "SOLN:AS01:111:STDZDIRECT.RVAL") field(INPD, "SOLN:AS01:111:STDZMINIDELTA") field(INPE, "SOLN:AS01:111: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, "SOLN:AS01:111: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, "SOLN:AS01:111:IADJUST.RVAL") field(INPB, "SOLN:AS01:111:STDZDIRECT.RVAL") field(INPC, "SOLN:AS01:111:STDZOK.RVAL") field(INPD, "SOLN:AS01:111:STDZDISABLE.RVAL") field(INPE, "SOLN:AS01:111:STATE.RVAL CPP NMS") field(INPF, "SOLN:AS01:111:ICTRL.RVAL") field(INPG, "SOLN:AS01:111:STATE.SEVR") field(INPH, "SOLN:AS01:111:BDELTAS.M") field(INPI, "SOLN:AS01:111:IACT.SEVR") field(OUT, "SOLN:AS01:111:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "SOLN:AS01:111:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "SOLN:AS01:111:STDZLOSTTOD.PROC") field(LNK2, "SOLN:AS01:111:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "SOLN:AS01:111:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "SOLN:AS01:111:CHECKPWRDIP_ENABLE") field(INPA, "SOLN:AS01:111:IACT CP") field(INPB, "SOLN:AS01:111:STDZIACTMAX") field(EGU, "A") field(FLNK, "SOLN:AS01:111: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, "SOLN:AS01:111:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "SOLN:AS01:111:CHECKPWRDIP_ENABLE") field(INPA, "SOLN:AS01:111:STDZIACTMAX") field(INPB, "SOLN:AS01:111:IACT") field(INPC, "SOLN:AS01:111:IDELTAS.I") field(OUT, "SOLN:AS01:111: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, "SOLN:AS01:111:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "SOLN:AS01:111:STDZOK.RVAL CP") field(INPB, "SOLN:AS01:111:STDZDISABLE.RVAL CP") field(INPC, "SOLN:AS01:111: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, "SOLN:AS01:111: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, "SOLN:AS01:111:CALBOK") { field(DESC, "Successful Calibration") field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "") 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, "SOLN:AS01:111:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "SOLN:AS01:111:CALBOK") field(INPB, "SOLN:AS01:111:CALBDISABLE") field(INPC, "SOLN:AS01:111:CALBSLOPE") field(OOPT, "On Change") field(OUT, "SOLN:AS01:111: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, "SOLN:AS01:111:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "SOLN:AS01:111: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, "SOLN:AS01:111:CALBSLOPE") field(DOL3, "SOLN:AS01:111:CALBOFFSET") field(DOL4, "0") field(DOL5, "0") field(LNK1, "MCOR:AS01:101:VSETPT.DISA PP NMS") field(LNK2, "MCOR:AS01:101:VSETPT.ASLO PP NMS") field(LNK3, "MCOR:AS01:101:VSETPT.AOFF PP NMS") field(LNK4, "MCOR:AS01:101:VSETPT.LINR PP NMS") field(LNK5, "MCOR:AS01:101:VSETPT.DISA PP NMS") # # 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, "MCOR:AS01:101:VSETPT.DISA PP NMS") field(LNK7, "MCOR:AS01:101:VSETPT.ASLO PP NMS") field(LNK8, "MCOR:AS01:101:VSETPT.AOFF PP NMS") field(LNK9, "MCOR:AS01:101:VSETPT.LINR PP NMS") field(LNKA, "MCOR:AS01:101:VSETPT.DISA PP NMS") } record(stringout, "SOLN:AS01:111:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "SOLN:AS01:111: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, "SOLN:AS01:111: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, "SOLN:AS01:111: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, "SOLN:AS01:111:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "SOLN:AS01:111: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, "SOLN:AS01:111:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "MCOR:AS01:101:VSETPT.ESLO") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "SOLN:AS01:111:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "SOLN:AS01:111:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "MCOR:AS01:101:VSETPT.EOFF") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "SOLN:AS01:111: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, "SOLN:AS01:111:CALCDAC") { field(DESC, "IACT to DAC Counts") field(CALC, "D=0?0:(((C*A)+B)-E)/D") field(INPA, "MCOR:AS01:101:I2VSLOPE") field(INPB, "0.0") field(INPC, "SOLN:AS01:111:IACT") field(INPD, "SOLN:AS01:111:DACSLOPE") field(INPE, "SOLN:AS01:111:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "SOLN:AS01:111:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "MCOR:AS01:101:VSETPT.RVAL CP") field(OMSL, "closed_loop") field(PREC, "6") field(PINI, "YES") } record(ao, "SOLN:AS01:111:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "5.0") field(HOPR, "5.0") field(DRVL, "-5.0") field(LOPR, "-5.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "SOLN:AS01:111:CALBIMAX") } record(ao, "SOLN:AS01:111:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "5.0") field(HOPR, "5.0") field(LOPR, "-5.0") field(DRVL, "-5.0") field(EGU, "A") field(VAL, "5.0") field(FLNK, "SOLN:AS01:111:CALBSTEPNUM") } record(ao, "SOLN:AS01:111:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "5.0") field(LOPR, "-5.0") field(VAL, "0") } record(longout, "SOLN:AS01:111: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, "SOLN:AS01:111:CALBIDELTA") } record(calc, "SOLN:AS01:111:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "SOLN:AS01:111:CALBIMAX") field(INPB, "SOLN:AS01:111:CALBIMIN") field(INPC, "SOLN:AS01:111: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, "SOLN:AS01:111:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "MCOR:AS01:101:ISETPT.DRVH") field(INPB, "MCOR:AS01:101:IACT.HOPR") field(INPC, "SOLN:AS01:111:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "SOLN:AS01:111:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "SOLN:AS01:111:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "SOLN:AS01:111:DACSA") } # Used only for xygraph edm plot record(subArray, "SOLN:AS01:111:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "SOLN:AS01:111: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, "SOLN:AS01:111:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "SOLN:AS01:111:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "SOLN:AS01:111:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "SOLN:AS01:111: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, "SOLN:AS01:111:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "SOLN:AS01:111:CALBYSA") } # Used only for xygraph edm plot record(subArray, "SOLN:AS01:111:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "SOLN:AS01:111:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "SOLN:AS01:111:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "SOLN:AS01:111:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "SOLN:AS01:111:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "SOLN:AS01:111:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "SOLN:AS01:111:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "SOLN:AS01:111: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, "SOLN:AS01:111:CALBSTEPNUM") field(INPB, "SOLN:AS01:111:CALBIACTWF") field(INPC, "SOLN:AS01:111: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, "SOLN:AS01:111: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, "SOLN:AS01:111:STDZITOL") field(INPH, "SOLN:AS01:111:DACSLOPE") field(INPI, "SOLN:AS01:111: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, "SOLN:AS01:111: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, "SOLN:AS01:111:CALBSTEPNUM") field(INPB, "SOLN:AS01:111:CALBIACTWF") field(INPC, "SOLN:AS01:111:DACWF") field(INPF, "SOLN:AS01:111: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 SOLN:AS01:111CALBOK 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, "SOLN:AS01:111:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "SOLN:AS01:111:DEGAUSIMIN.PROC PP") field(OUTB, "SOLN:AS01:111:DEGAUSIMAX.PROC PP") field(OUTC, "SOLN:AS01:111:DEGAUSTYPE.PROC PP") field(OUTD, "SOLN:AS01:111:DEGAUSSTEP.PROC PP") field(OUTE, "SOLN:AS01:111:MADNAME.PROC PP") field(OUTF, "SOLN:AS01:111:PSTYPE.PROC PP") field(OUTG, "SOLN:AS01:111: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, "SOLN:AS01:111:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "SOLN:AS01:111:DEGAUSIMIN NPP NMS") field(INPB, "SOLN:AS01:111:DEGAUSIMAX NPP NMS") field(INPC, "SOLN:AS01:111:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "SOLN:AS01:111:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "SOLN:AS01:111:PSTYPE NPP NMS") field(INPG, "SOLN:AS01:111:DEBUG.RVAL NPP NMS") field(INPH, "SOLN:AS01:111: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, "SOLN:AS01:111:DEGAUSWF PP") field(OUTB, "SOLN:AS01:111:DEGAUSMSG PP") field(OUTC, "SOLN:AS01:111: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, "SOLN:AS01:111:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"SOLN:AS01:111: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, "SOLN:AS01:111: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, "SOLN:AS01:111: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, "SOLN:AS01:111: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, "SOLN:AS01:111: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, "SOLN:AS01:111:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "5.0") field(LOPR, "-5.0") field(DRVH, "5.0") field(DRVL, "-5.0") field(VAL, "-5.0") } record(ao, "SOLN:AS01:111:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "5.0") field(LOPR, "-5.0") field(DRVH, "5.0") field(DRVL, "-5.0") field(VAL, "5.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,"SOLN:AS01:111: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, "SOLN:AS01:111: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,"SOLN:AS01:111: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, "SOLN:AS01:111: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, "SOLN:AS01:111: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, "SOLN:AS01:111: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, "SOLN:AS01:111:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "SOLN:AS01:111:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "SOLN:AS01:111:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "SOLN:AS01:111:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "SOLN:AS01:111: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, "SOLN:AS01:111:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "SOLN:AS01:111: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, "SOLN:AS01:111:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "SOLN:AS01:111:DEGAUS_IMAX") field(INPB, "SOLN:AS01:111:ISETPT") field(INPC, "SOLN:AS01:111:DEGAUSTYPE.RVAL") field(OUT, "SOLN:AS01:111:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "SOLN:AS01:111:DEGAUS_IMAX_UPDATE") } record(seq, "SOLN:AS01:111:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "SOLN:AS01:111:ISETPT") field(LNK1, "SOLN:AS01:111:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "SOLN:AS01:111:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "5.0") field(LOPR, "-5.0") field(DRVH, "5.0") field(DRVL, "-5.0") field(VAL, "5.0") field(FLNK, "SOLN:AS01:111:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "SOLN:AS01:111:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "SOLN:AS01:111:DEGAUS_IMAX") field(FLNK, "SOLN:AS01:111:DEGAUS_IMAXPOL") } record(bo, "SOLN:AS01:111:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "SOLN:AS01:111:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "SOLN:AS01:111: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, "SOLN:AS01:111:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "SOLN:AS01:111:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "5.0") field(LOPR, "-5.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "SOLN:AS01:111:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "SOLN:AS01:111:IACT") field(INPB, "SOLN:AS01:111:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "SOLN:AS01:111:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "SOLN:AS01:111:IACTPOL") } record(bo, "SOLN:AS01:111: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,"SOLN:AS01:111: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, "SOLN:AS01:111:DEGAUSENABLE CP") field(INPB, "SOLN:AS01:111:DEGAUSOK") field(INPC, "SOLN:AS01:111:STATE CP") field(INPD, "SOLN:AS01:111:STATE.SEVR") field(OUT, "SOLN:AS01:111:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "SOLN:AS01:111:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "SOLN:AS01:111:DEGAUS_STATE_CHECK") field(LNK1, "SOLN:AS01:111:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "SOLN:AS01:111:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "SOLN:AS01:111:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "SOLN:AS01:111: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, "SOLN:AS01:111:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "SOLN:AS01:111:DEGAUSOK.ZSV") field(LNK2, "SOLN:AS01:111: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, "SOLN:AS01:111:STATMSG.FRSV") field(LNK4, "SOLN:AS01:111: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, "SOLN:AS01:111:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "SOLN:AS01:111:DEGAUSOK.ZSV") field(LNK2, "SOLN:AS01:111: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, "SOLN:AS01:111:STATMSG.FRSV") field(LNK4, "SOLN:AS01:111: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, "SOLN:AS01:111:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "SOLN:AS01:111: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, "SOLN:AS01:111:STATMSG.FRSV") field(LNK3, "SOLN:AS01:111: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, "SOLN:AS01:111:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "SOLN:AS01:111: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, "SOLN:AS01:111:STATMSG.FRSV PP") field(LNK3, "SOLN:AS01:111:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "SOLN:AS01:111:FUNC") { field(DESC, "SOLN:AS01:111 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, "0") field(NIVL, "0") field(TEVL, "0") field(ELVL, "5") field(TVVL, "6") field(TTVL, "7") field(FTVL, "4") field(FFVL, "3") field(OUT, "SOLN:AS01:111:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "SOLN:AS01:111:CTRL") { field(DESC, "SOLN:AS01:111 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, "") field(TVST, "") field(TTST, "") 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, "0") field(TVVL, "0") field(TTVL, "0") field(FTVL, "0") field(FFVL, "0") field(OUT, "SOLN:AS01:111:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "SOLN:AS01:111:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "SOLN:AS01:111:BUSY") } # Set to FREE on IOC reboot record(bo, "SOLN:AS01:111:BUSY") { field(DESC, "SOLN:AS01:111 Ctrl Done") field(DOL, "SOLN:AS01:111:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "SOLN:AS01:111:SELECT") } record(bo, "SOLN:AS01:111:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "SOLN:AS01:111: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, "SOLN:AS01:111:CTRLSTATE") { field(DESC, "SOLN:AS01:111 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("SOLN:AS01:111:CTRL",20,20,0,0,"SOLN:AS01:111:CTRL") #! Field("SOLN:AS01:111:CTRL.OUT",16777215,1,"SOLN:AS01:111:CTRL.OUT") #! Link("SOLN:AS01:111:CTRL.OUT","SOLN:AS01:111:SELECTEN.A") #! Field("SOLN:AS01:111:CTRL.VAL",16777215,1,"SOLN:AS01:111:CTRL.VAL") #! Record("SOLN:AS01:111:SELECTEN",321,381,0,0,"SOLN:AS01:111:SELECTEN") #! Field("SOLN:AS01:111:SELECTEN.A",16777215,0,"SOLN:AS01:111:SELECTEN.A") #! Field("SOLN:AS01:111:SELECTEN.FLNK",16777215,1,"SOLN:AS01:111:SELECTEN.FLNK") #! Link("SOLN:AS01:111:SELECTEN.FLNK","SOLN:AS01:111:BUSY") #! Field("SOLN:AS01:111:SELECTEN.VAL",16777215,1,"SOLN:AS01:111:SELECTEN.VAL") #! Record("SOLN:AS01:111:BUSY",623,274,0,0,"SOLN:AS01:111:BUSY") #! Field("SOLN:AS01:111:BUSY.DOL",16777215,0,"SOLN:AS01:111:BUSY.DOL") #! Link("SOLN:AS01:111:BUSY.DOL","SOLN:AS01:111:SELECTEN.VAL") #! Field("SOLN:AS01:111:BUSY.FLNK",16777215,1,"SOLN:AS01:111:BUSY.FLNK") #! Link("SOLN:AS01:111:BUSY.FLNK","SOLN:AS01:111:SELECT") #! Record("SOLN:AS01:111:SELECT",669,508,0,1,"SOLN:AS01:111:SELECT") #! Record("SOLN:AS01:111:FUNC",940,120,0,0,"SOLN:AS01:111:FUNC") #! Field("SOLN:AS01:111:FUNC.OUT",16777215,0,"SOLN:AS01:111:FUNC.OUT") #! Link("SOLN:AS01:111:FUNC.OUT","SOLN:AS01:111:CTRL.VAL") #! Record("SOLN:AS01:111:ABORT",193,41,0,0,"SOLN:AS01:111:ABORT") #! Record("SOLN:AS01:111:CTRLSTATE",369,34,0,0,"SOLN:AS01:111: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,"SOLN:AS01:111:SELECT is used for Multi-device selection.\nIt is enabled when associated SOLN:AS01:111:CTRL is \"0\" (DONE).\nIt is disabled when associated SOLN:AS01:111: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,"SOLN:AS01:111: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, "SOLN:AS01:111:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "SOLN:AS01:111:BCTRL.SEVR") field(OUT, "SOLN:AS01:111: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, "SOLN:AS01:111:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "SOLN:AS01:111:BACT") field(INPB, "SOLN:AS01:111:POLYCOEF") field(INPC, "SOLN:AS01:111:POLYCOEF.A") field(INPD, "SOLN:AS01:111:POLYCOEF.B") field(INPE, "SOLN:AS01:111:IACT MS") field(INPF, "SOLN:AS01:111:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "87.0") field(LOPR, "-87.0") field(HIHI, "87.0") field(LOLO, "-87.0") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "87.0") field(LOW, "-87.0") field(FLNK, "SOLN:AS01:111: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, "SOLN:AS01:111: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, "SOLN:AS01:111:BDES") field(INPB, "SOLN:AS01:111:TRIMBTOL") field(INPC, "SOLN:AS01:111:TRIMBTOLR") field(INPD, "SOLN:AS01:111:CHCKBTOL") field(INPE, "SOLN:AS01:111:CHCKBTOLR") field(F, "0.0") field(INPG, "30") field(INPH, "SOLN:AS01:111:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "SOLN:AS01:111:MPSBTOL") field(INPQ, "SOLN:AS01:111:MPSBTOLR") field(FLNK, "SOLN:AS01:111:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "SOLN:AS01:111:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "SOLN:AS01:111:BDES") field(INPB, "SOLN:AS01:111:BDELTAS.I") field(INPG, "SOLN:AS01:111:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "SOLN:AS01:111:BCON.HIGH") field(OUTB, "SOLN:AS01:111:BCON.LOW") field(OUTC, "SOLN:AS01:111:BCON.HIHI") field(OUTD, "SOLN:AS01:111:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "SOLN:AS01:111:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "SOLN:AS01:111:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "SOLN:AS01:111:BDIFF") field(LNK2, "SOLN:AS01:111:BADIFF") field(LNK3, "SOLN:AS01:111:BRATIO") field(LNK4, "SOLN:AS01:111:MPSLIMITS") field(LNK5, "SOLN:AS01:111:I2BSTATUS") field(LNK6, "SOLN:AS01:111:IACTFO.PROC") } record(calc, "SOLN:AS01:111:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "SOLN:AS01:111:BDES") field(INPB, "SOLN:AS01:111:BACT") field(EGU, "kG") field(PREC, "7") } record(calc, "SOLN:AS01:111:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "SOLN:AS01:111:BDIFF") field(EGU, "kG") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "SOLN:AS01:111:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "SOLN:AS01:111:BDIFF") field(INPB, "SOLN:AS01:111:BDES.HOPR") field(EGU, "kG") field(PREC, "7") } record(mbbi, "SOLN:AS01:111: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, "SOLN:AS01:111:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "SOLN:AS01:111:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "SOLN:AS01:111:BMON") field(INPB, "SOLN:AS01:111:POLYCOEF") field(INPC, "SOLN:AS01:111:POLYCOEF.A") field(INPD, "SOLN:AS01:111:POLYCOEF.B") field(INPE, "SOLN:AS01:111:IMON MS") field(INPF, "SOLN:AS01:111:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG") field(HOPR, "87.0") field(LOPR, "-87.0") field(HIHI, "87.0") field(LOLO, "-87.0") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "87.0") field(LOW, "-87.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=MCOR:AS01:101:BDES CP record(ao, "SOLN:AS01:111:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "87.0") field(DRVL, "-87.0") field(HOPR, "87.0") field(LOPR, "-87.0") field(PREC, "7") field(EGU, "kG") field(MDEL, "-1") field(OMSL, "supervisory") # field(DOL, "") field(OUT, "SOLN:AS01:111:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "SOLN:AS01:111:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "SOLN:AS01:111:POLYCOEF") field(INPC, "SOLN:AS01:111:POLYCOEF.A") field(INPD, "SOLN:AS01:111:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "87.0") field(LOPR, "-87.0") field(MDEL, "-1") field(INPE, "SOLN:AS01:111:BDES.DRVH") field(INPF, "SOLN:AS01:111:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "SOLN:AS01:111:IDES") } record(sub, "SOLN:AS01:111:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "SOLN:AS01:111:POLYCOEF") field(INPC, "SOLN:AS01:111:POLYCOEF.A") field(INPD, "SOLN:AS01:111:POLYCOEF.B") field(INPE, "SOLN:AS01:111:BDES.DRVH") field(INPF, "SOLN:AS01:111:BDES.DRVL") field(EGU, "kG") field(HOPR, "87.0") field(LOPR, "-87.0") field(PREC, "7") field(VAL, "0.0") field(FLNK, "SOLN:AS01:111:INOM") } record(sub, "SOLN:AS01:111:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "SOLN:AS01:111:BDES.VAL") field(INPB, "SOLN:AS01:111:BDES.DRVH") field(INPC, "SOLN:AS01:111:BDES.DRVL") field(INPD, "SOLN:AS01:111:BDELTAS.I") field(INPE, "SOLN:AS01:111:BDELTAS.J") field(INPG, "SOLN:AS01:111:STATE") field(INPH, "SOLN:AS01:111:HSTA") field(EGU, "kG") field(HOPR, "87.0") field(LOPR, "-87.0") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "SOLN:AS01:111:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "SOLN:AS01:111:BDES.VAL") field(INPB, "SOLN:AS01:111:BDES.DRVH") field(INPC, "SOLN:AS01:111:BDES.DRVL") field(INPD, "SOLN:AS01:111:BDELTAS.K") field(INPE, "SOLN:AS01:111:BDELTAS.L") field(INPG, "SOLN:AS01:111:STATE") field(INPH, "SOLN:AS01:111:HSTA") field(EGU, "kG") field(HOPR, "87.0") field(LOPR, "-87.0") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "SOLN:AS01:111:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "SOLN:AS01:111:BLIMITS") field(LNK1, "SOLN:AS01:111:BACTLIMITS.F PP") field(DOL2, "SOLN:AS01:111:BACTLIMITS.I") field(LNK2, "SOLN:AS01:111:BACT.HIGH") field(DOL3, "SOLN:AS01:111:BACTLIMITS.J") field(LNK3, "SOLN:AS01:111:BACT.LOW") field(DOL4, "SOLN:AS01:111:BACTLIMITS.K") field(LNK4, "SOLN:AS01:111:BACT.HIHI") field(DOL5, "SOLN:AS01:111:BACTLIMITS.L") field(LNK5, "SOLN:AS01:111:BACT.LOLO") field(DOL6, "SOLN:AS01:111:BLIMITS") field(LNK6, "SOLN:AS01:111:BMONLIMITS.F PP") field(DOL7, "SOLN:AS01:111:BMONLIMITS.I") field(LNK7, "SOLN:AS01:111:BMON.HIGH") field(DOL8, "SOLN:AS01:111:BMONLIMITS.J") field(LNK8, "SOLN:AS01:111:BMON.LOW") field(DOL9, "SOLN:AS01:111:BMONLIMITS.K") field(LNK9, "SOLN:AS01:111:BMON.HIHI") field(DOLA, "SOLN:AS01:111:BMONLIMITS.L") field(LNKA, "SOLN:AS01:111:BMON.LOLO") field(FLNK, "SOLN:AS01:111:ILIMITS") field(SCAN, "5 second") } record(ao, "SOLN:AS01:111:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG") field(DRVH, "87.0") field(DRVL, "-87.0") field(HOPR, "87.0") field(LOPR, "-87.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, "SOLN:AS01:111: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, "SOLN:AS01:111:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "SOLN:AS01:111:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "SOLN:AS01:111:BCTRL.VAL") field(LNK2, "SOLN:AS01:111:BDES PP") field(DOL3, "1") field(LNK3, "SOLN:AS01:111:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "SOLN:AS01:111:CHECKSTDZLOST.PROC PP") field(DOL5, "SOLN:AS01:111:BCTRL.VAL") field(LNK5, "SOLN:AS01:111:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "SOLN:AS01:111:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "SOLN:AS01:111:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "SOLN:AS01:111:POLYCOEF") field(INPC, "SOLN:AS01:111:POLYCOEF.A") field(INPD, "SOLN:AS01:111:POLYCOEF.B") field(INPE, "SOLN:AS01:111:BDES.DRVH") field(INPF, "SOLN:AS01:111:BDES.DRVL") field(PREC, "7") field(EGU, "kG") field(HOPR, "87.0") field(LOPR, "-87.0") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "SOLN:AS01:111:ISETPT") } record(ao, "SOLN:AS01:111:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "87.0") field(DRVL, "-87.0") field(EGU, "kG") field(HOPR, "87.0") field(LOPR, "-87.0") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "SOLN:AS01:111:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "SOL1BKS") } record(ai, "SOLN:AS01:111: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, "2017.911") } record(ao, "SOLN:AS01:111:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "87.0") field(DRVL, "-87.0") field(EGU, "kG") field(HOPR, "87.0") field(LOPR, "-87.0") field(PREC, "7") field(PINI, "YES") field(VAL, "87.0") field(FLNK, "SOLN:AS01:111:BSTEP") } record(ao, "SOLN:AS01:111:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "87.0") field(DRVL, "-87.0") field(EGU, "kG") field(HOPR, "87.0") field(LOPR, "-87.0") field(PREC, "7") field(PINI, "YES") field(VAL, "-87.0") field(FLNK, "SOLN:AS01:111:BSTEP") } record(ao, "SOLN:AS01:111:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "87.0") field(DRVL, "-87.0") field(EGU, "kG") field(HOPR, "87.0") field(LOPR, "-87.0") field(PINI, "YES") field(PREC, "7") } # This record is processed by SOLN:AS01:111: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, "SOLN:AS01:111:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG") field(HOPR, "87.0") field(LOPR, "-87.0") field(DRVH, "87.0") field(DRVL, "-87.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, "SOLN:AS01:111:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "SOLN:AS01:111:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "SOLN:AS01:111:POLYCOEF") field(INPC, "SOLN:AS01:111:POLYCOEF.A") field(INPD, "SOLN:AS01:111:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "87.0") field(LOPR, "-87.0") field(MDEL, "-1") field(INPE, "SOLN:AS01:111:BCON.DRVH") field(INPF, "SOLN:AS01:111:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "SOLN:AS01:111: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, "SOLN:AS01:111:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "SOLN:AS01:111:BMAX") field(INPB, "SOLN:AS01:111:BMIN") field(INPC, "SOLN:AS01:111:BMIN.SEVR") field(INPD, "SOLN:AS01:111: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,"SOLN:AS01:111:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "SOLN:AS01:111:ONLINE CP") field(OUT, "SOLN:AS01:111:BCTRLDISABLEFOUT PP") } record(fanout, "SOLN:AS01:111:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "SOLN:AS01:111:BCTRLDISABLECALC") field(LNK1, "SOLN:AS01:111:BCTRLDISABLE") field(LNK2, "SOLN:AS01:111:BCTRLENABLE") } record(stringout, "SOLN:AS01:111:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "SOLN:AS01:111:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "SOLN:AS01:111:BCTRLDISV_UPDATE") } record(stringout, "SOLN:AS01:111:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "SOLN:AS01:111:BCTRL.ASG") field(VAL, "") field(FLNK, "SOLN:AS01:111:BCTRLDISV_UPDATE") } record(calcout, "SOLN:AS01:111:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "SOLN:AS01:111:ONLINE") field(OUT, "SOLN:AS01:111: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,"SOLN:AS01:111:BACT and MON\n are processed via links from \n SOLN:AS01:111:IACT (device raw value readback 1)\n and\n SOLN:AS01:111: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 SOLN:AS01:111:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = SOLN:AS01:111: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,"SOLN:AS01:111:BDES\n is processed when set by CA users or \n SOLN:AS01:111: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,"SOLN:AS01:111: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 SOLN:AS01:111: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 (SOLN:AS01:111: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,"SOLN:AS01:111:B*LIMITS and SOLN:AS01:111:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from SOLN:AS01:111: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,"SOLN:AS01:111: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,"SOLN:AS01:111: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, "SOLN:AS01:111: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, "SOLN:AS01:111:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "SOLN:AS01:111:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "SOLN:AS01:111:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "87.0") field(DRVL, "-87.0") field(PINI, "YES") field(VAL, "87.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "SOLN:AS01:111:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "87.0") field(DRVL, "-87.0") field(PINI, "YES") field(VAL, "-87.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "SOLN:AS01:111:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "87.0") field(DRVL, "-87.0") field(PINI, "YES") field(VAL, "-87.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "SOLN:AS01:111:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "87.0") field(DRVL, "-87.0") field(PINI, "YES") field(VAL, "-87.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "SOLN:AS01:111: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, "SOLN:AS01:111:MPSLIMITS.E PP") } record(aSub, "SOLN:AS01:111: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, "SOLN:AS01:111:MPS.RVAL") field(INPB, "SOLN:AS01:111:BADIFF") field(INPC, "SOLN:AS01:111:BDELTAS.N") field(INPD, "SOLN:AS01:111:BACT") field(INPE, "SOLN:AS01:111:MPSBITMASK.RVAL") field(INPF, "SOLN:AS01:111:MPSBLLIM") field(INPG, "SOLN:AS01:111:MPSBMIN") field(INPH, "SOLN:AS01:111:MPSBMAX") field(INPI, "SOLN:AS01:111: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, "SOLN:AS01:111:INTOL.RVAL PP") field(OUTB, "SOLN:AS01:111:INTOL_BMIN.RVAL PP") field(OUTC, "SOLN:AS01:111:INTOL_BRANGE.RVAL PP") field(OUTD, "SOLN:AS01:111: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, "SOLN:AS01:111:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "SOLN:AS01:111:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "SOLN:AS01:111:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "SOLN:AS01:111:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "SOLN:AS01:111:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "SOLN:AS01:111:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "SOLN:AS01:111:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "SOLN:AS01:111: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, "SOLN:AS01:111:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "SOLN:AS01:111:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "SOLN:AS01:111:CHCKBTOL") field(INPB, "SOLN:AS01:111:POLYCOEF.B") field(PREC, "9") } record(calc, "SOLN:AS01:111: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, "SOLN:AS01:111:CHCKBTOL") field(FLNK, "SOLN:AS01:111:CHCKITOL") } record(calc, "SOLN:AS01:111:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "SOLN:AS01:111:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "SOLN:AS01:111:BDES.HOPR") field(INPB, "SOLN:AS01:111:STABILITY") field(INPC, "SOLN:AS01:111:BDES.LOPR") } record(longout, "SOLN:AS01:111:STABILITY") { field(DESC, "Long Term Stability") field(PINI, "YES") field(VAL, "1000") field(EGU, "ppm") field(DRVH, "3000") field(DRVL, "100") field(HOPR, "3000") field(LOPR, "100") field(FLNK, "SOLN:AS01:111:CHCKBTOL") } record(calc, "SOLN:AS01:111:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG") field(CALC, "ABS(A*B)") field(INPA, "SOLN:AS01:111:POLYCOEF.B") field(INPB, "SOLN:AS01:111:TRIMBTOL") field(PREC, "9") } record(ai, "SOLN:AS01:111:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "SOLN:AS01:111: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, "SOLN:AS01:111:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "SOLN:AS01:111:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "SOLN:AS01:111:PAUGO") } record(fanout, "SOLN:AS01:111:PAUGO") { field(DESC, "PAU control") field(LNK1, "SOLN:AS01:111:PAUSTOP") field(LNK2, "SOLN:AS01:111: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, "SOLN:AS01:111:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "SOLN:AS01:111:PAU.RVAL") field(DISV, "0") field(DOL1, "0") field(DOL2, "0") field(DOL3, "1") field(DLY3, "1") # field(LNK1, "MCOR:AS01:101:ISETPT.DISV") # field(LNK2, "MCOR:AS01:101:VSETPT.DISV") # field(LNK3, "ACTPAU PP") } record(seq, "SOLN:AS01:111:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "SOLN:AS01:111:PAU.RVAL") field(DISV, "1") field(DOL1, "1") field(DOL2, "1") field(DOL3, "0") # field(LNK1, "MCOR:AS01:101:ISETPT.DISV") # field(LNK2, "MCOR:AS01:101:VSETPT.DISV") # field(LNK3, "ACTPAU PP") } # Change attribute to PSDEVNAME record(stringout, "SOLN:AS01:111:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "MCOR:AS01:101:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "SOLN:AS01:111: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, "SOLN:AS01:111:PSTYPE.RVAL") field(INPC, "SOLN:AS01:111:TURNEDOFF.RVAL") field(INPD, "SOLN:AS01:111:CONFIG.RVAL") field(INPE, "SOLN:AS01:111:PSCATEGORY.RVAL") field(INPF, "SOLN:AS01:111:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "SOLN:AS01:111:AUTOCTRL.RVAL") field(INPJ, "SOLN:AS01:111:OUTOFSERVICE.RVAL") field(INPL, "SOLN:AS01:111:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "SOLN:AS01:111:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "SOLN:AS01:111:PAU") field(INPP, "SOLN:AS01:111:CALBDISABLE.RVAL") field(INPQ, "SOLN:AS01:111:PTRBDISABLE.RVAL") field(INPR, "SOLN:AS01:111:TRIMDISABLE.RVAL") field(INPS, "SOLN:AS01:111:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "SOLN:AS01:111:FBCK") field(INPU, "SOLN:AS01:111:TRIMTYPE.RVAL") field(INPV, "SOLN:AS01:111:STDZDIRECT.RVAL") field(INPW, "SOLN:AS01:111:DEGAUSENABLE.RVAL") field(FLNK, "SOLN:AS01:111:HSTA") } record(longin, "SOLN:AS01:111:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "SOLN:AS01:111:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "SOLN:AS01:111: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, "SOLN:AS01:111: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, "SOLN:AS01:111: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, "SOLN:AS01:111: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, "SOLN:AS01:111: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, "SOLN:AS01:111: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 SOLN:AS01:111:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses SOLN:AS01:111:FBCK. # This PV should be replaced by SOLN:AS01:111: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, "SOLN:AS01:111: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, "SOLN:AS01:111: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, "SOLN:AS01:111: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, "SOLN:AS01:111:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"SOLN:AS01:111:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "SOLN:AS01:111:OUTOFSERVICE NPP NMS") field(OUT, "SOLN:AS01:111:ONLINE PP") } record(bo, "SOLN:AS01:111:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "SOLN:AS01:111: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, "SOLN:AS01:111: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, "SOLN:AS01:111: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, "SOLN:AS01:111: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, "SOLN:AS01:111: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, "SOLN:AS01:111: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, "SOLN:AS01:111: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, "SOLN:AS01:111: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, "SOLN:AS01:111: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, "0") field(ASG, "NOWRITE") } record(mbbo, "SOLN:AS01:111: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, "0") field(ASG, "NOWRITE") } record(mbbo, "SOLN:AS01:111: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, "SOLN:AS01:111:TRIMTYPE") } record(stringout, "SOLN:AS01:111:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "SOLN:AS01:111:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "SOLN:AS01:111:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "SOLN:AS01:111:STATE.RVAL") field(INPB, "SOLN:AS01:111:INTLKSUMY.RVAL") field(OUT, "SOLN:AS01:111:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "SOLN:AS01:111: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, "SOLN:AS01:111:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "SOLN:AS01:111:STATE.RVAL") field(INPB, "SOLN:AS01:111:INTLKSUMY.RVAL") field(OUT, "SOLN:AS01:111:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "SOLN:AS01:111:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "SOLN:AS01:111:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "SOLN:AS01:111: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, "SOLN:AS01:111: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, "SOLN:AS01:111: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, "SOLN:AS01:111: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,"SOLN:AS01:111: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("SOLN:AS01:111:TURNEDOFF",3140,1907,0,1,"SOLN:AS01:111:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "SOLN:AS01:111:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "SOLN:AS01:111:BACT.STAT") field(INPB, "SOLN:AS01:111:BDES.STAT") field(INPC, "SOLN:AS01:111:IRIPL.STAT") field(INPD, "MCOR:AS01:101:VSETPT.STAT") field(INPE, "MCOR:AS01:101:VACT.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, "SOLN:AS01:111:BACT.SEVR") field(INPH, "SOLN:AS01:111:BDES.SEVR") field(INPI, "SOLN:AS01:111:IRIPL.SEVR") field(INPJ, "MCOR:AS01:101:VSETPT.SEVR") field(INPK, "MCOR:AS01:101:VACT.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, "SOLN:AS01:111:STATE.RVAL") field(INPN, "SOLN:AS01:111:STDZOK") field(INPO, "SOLN:AS01:111:CALBOK") field(INPP, "SOLN:AS01:111:OUTOFSERVICE.RVAL") field(INPQ, "SOLN:AS01:111:CONFIG.RVAL") field(INPR, "SOLN:AS01:111:HSTA") field(INPS, "SOLN:AS01:111:CTRL.RVAL") field(INPT, "SOLN:AS01:111:DEGAUSOK") field(INPV, "SOLN:AS01:111: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, "SOLN:AS01:111:STAT") } record(longout, "SOLN:AS01:111:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "SOLN:AS01:111:STATCTRLSUB") field(DOL, "SOLN:AS01:111:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "SOLN:AS01:111:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "SOLN:AS01:111:STAT") field(INPB, "SOLN:AS01:111:HSTA") field(INPD, "SOLN:AS01:111:ONOFFCTRL.RVAL") field(FLNK, "SOLN:AS01:111:STATMSG") } record(mbbo, "SOLN:AS01:111: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, "SOLN:AS01:111:UNAVAILGO") field(DOL, "SOLN:AS01:111:STATCTRLSUB.W") } record(seq, "SOLN:AS01:111:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "SOLN:AS01:111:STATSUB.U") field(LNK1, "SOLN:AS01:111:UNAVAIL PP") } record(stringout, "SOLN:AS01:111:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"SOLN:AS01:111:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - SOLN:AS01:111:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - SOLN:AS01:111: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,"SOLN:AS01:111STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - SOLN:AS01:111:STATUS\nC - SOLN:AS01:111:ON\nD - SOLN:AS01:111:STDZOK\nE - SOLN:AS01:111:CALBOK\nF - SOLN:AS01:111:BACTDRIFT (future)\nG -\nH- SOLN:AS01:111:DACSTATUS\nI -SOLN:AS01:111:ADCSTATUS\nJ - SOLN:AS01:111:BACTSTATUS\nK - SOLN:AS01:111:BDESSTATUS\nL - SOLN:AS01:111:RIPLSTATUS\n\nOutput:\nP - SOLN:AS01:111: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, "SOLN:AS01:111: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, "SOLN:AS01:111: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, "SOLN:AS01:111: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, "SOLN:AS01:111: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 # Note: for slave with trim coils # set the macro ACT to the following: # ACT=:IACTCALC record(ai, "QUAD:AS01:121:IACT") { field(DESC, "Current") field(INP, "MCOR:AS01:102:IACT") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:AS01:121:BACT") info(autosaveFields,"HYST") } record(bi, "QUAD:AS01:121:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "MCOR:AS01:102:STATE NPP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "QUAD:AS01:121:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "6.0") field(LOLO, "-6.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:AS01:121:BDELTAS") field(DRVH, "6.0") field(DRVL, "-6.0") field(DOL, "QUAD:AS01:121: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:AS01:121:ICTRL PP") } # This record is processed by QUAD:AS01:121:ICON") # Note: we are not setting alarms here. record(ao, "QUAD:AS01:121:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(DOL, "QUAD:AS01:121:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "QUAD:AS01:121:INOM") { field(DESC, "Nominal Current") field(DOL, "QUAD:AS01:121:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "6.0") field(DRVL, "-6.0") field(HOPR, "6.0") field(LOPR, "-6.0") } record(ao, "QUAD:AS01:121:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(MDEL, "-1") field(FLNK, "QUAD:AS01:121:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "QUAD:AS01:121:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "QUAD:AS01:121:ISETPT.OMSL") field(DOL2, "QUAD:AS01:121:ICTRL") field(LNK2, "QUAD:AS01:121:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "QUAD:AS01:121:ISETPT.OMSL") } record(ao, "QUAD:AS01:121:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "6.0") field(DRVL, "-6.0") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(PINI, "YES") field(VAL, "6.0") field(FLNK, "QUAD:AS01:121:IMIN") } record(ao, "QUAD:AS01:121:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "6.0") field(DRVL, "-6.0") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(VAL, "-6.0") field(FLNK, "QUAD:AS01:121:IRANGE") } record(sel, "QUAD:AS01:121:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(NVL, "QUAD:AS01:121:BACT.SEVR") field(INPA, "QUAD:AS01:121:IACT NPP MS") field(INPB, "QUAD:AS01:121:IACTPREVOK NPP MS") field(INPC, "QUAD:AS01:121:IACTPREVOK NPP MS") field(INPD, "QUAD:AS01:121:IACTPREVOK NPP MS") } record(sub, "QUAD:AS01:121:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:AS01:121:IDES") field(INPB, "QUAD:AS01:121:ISETPT.DRVH") field(INPC, "QUAD:AS01:121:ISETPT.DRVL") field(INPD, "QUAD:AS01:121:IDELTAS.I") field(INPE, "QUAD:AS01:121:IDELTAS.J") field(INPG, "QUAD:AS01:121:STATE") field(INPH, "QUAD:AS01:121:HSTA") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "QUAD:AS01:121:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:AS01:121:IDES") field(INPB, "QUAD:AS01:121:ISETPT.DRVH") field(INPC, "QUAD:AS01:121:ISETPT.DRVL") field(INPD, "QUAD:AS01:121:IDELTAS.K") field(INPE, "QUAD:AS01:121:IDELTAS.L") field(INPG, "QUAD:AS01:121:STATE") field(INPH, "QUAD:AS01:121:HSTA") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "QUAD:AS01:121:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "QUAD:AS01:121:BLIMITS") field(LNK1, "QUAD:AS01:121:IACTLIMITS.F PP") field(DOL2, "QUAD:AS01:121:IACTLIMITS.I") field(LNK2, "QUAD:AS01:121:IACT.HIGH") field(DOL3, "QUAD:AS01:121:IACTLIMITS.J") field(LNK3, "QUAD:AS01:121:IACT.LOW") field(DOL4, "QUAD:AS01:121:IACTLIMITS.K") field(LNK4, "QUAD:AS01:121:IACT.HIHI") field(DOL5, "QUAD:AS01:121:IACTLIMITS.L") field(LNK5, "QUAD:AS01:121:IACT.LOLO") field(DOL6, "QUAD:AS01:121:BLIMITS") field(LNK6, "QUAD:AS01:121:IMONLIMITS.F PP") field(DOL7, "QUAD:AS01:121:IMONLIMITS.I") field(LNK7, "QUAD:AS01:121:IMON.HIGH") field(DOL8, "QUAD:AS01:121:IMONLIMITS.J") field(LNK8, "QUAD:AS01:121:IMON.LOW") field(DOL9, "QUAD:AS01:121:IMONLIMITS.K") field(LNK9, "QUAD:AS01:121:IMON.HIHI") field(DOLA, "QUAD:AS01:121:IMONLIMITS.L") field(LNKA, "QUAD:AS01:121: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:AS01:121:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "QUAD:AS01:121:TRIMBTOL") field(INPE, "QUAD:AS01:121:CHCKBTOL") field(INPF, "QUAD:AS01:121:BDELTAS.K") field(INPG, "QUAD:AS01:121:BDELTAS.L") field(INPH, "QUAD:AS01:121: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:AS01:121:STDZITOLR") field(INPC, "QUAD:AS01:121:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = MCOR:AS01:102: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:AS01:121: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 = MCOR:AS01:102:RESET PP # record(bo, "QUAD:AS01:121:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "MCOR:AS01:102:RESET PP") } record(bo, "QUAD:AS01:121:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "") 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:AS01:121: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:AS01:121:TRIMRAMPRATE") field(OUT, "") field(FLNK, "QUAD:AS01:121:STDZDLY") } record(ao, "QUAD:AS01:121:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(MDEL, "-1") field(OUT, "MCOR:AS01:102:ISETPT PP") field(DOL, "QUAD:AS01:121: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:AS01:121:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:AS01:121:BMON") } record(ao, "QUAD:AS01:121:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "QUAD:AS01:121:IRIPLOK") } record(sub, "QUAD:AS01:121:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "QUAD:AS01:121:IRIPL.VAL") field(INPB, "QUAD:AS01:121: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:AS01:121: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, "QUAD:AS01:121:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") } record(bi, "QUAD:AS01:121:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "MCOR:AS01:102:INTLKSUMY NPP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "QUAD:AS01:121: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, "MCOR:AS01:102:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "QUAD:AS01:121:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "QUAD:AS01:121:IACTPREVOK") field(LNK2, "QUAD:AS01:121:IDIFF") field(LNK3, "QUAD:AS01:121:IADIFF") field(LNK4, "QUAD:AS01:121:IRATIO") field(LNK5, "QUAD:AS01:121:IDIRECT") field(LNK6, "QUAD:AS01:121:IACTPOL_CHECK") } record(calc, "QUAD:AS01:121:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "QUAD:AS01:121:IDES") field(INPB, "QUAD:AS01:121:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "6.0") field(LOPR, "-6.0") } record(calc, "QUAD:AS01:121:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "QUAD:AS01:121:IDIFF") field(PREC, "9") } record(calc, "QUAD:AS01:121:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "QUAD:AS01:121:IDIFF") field(INPB, "QUAD:AS01:121:IDES.DRVH") field(PREC, "9") } record(calcout, "QUAD:AS01:121:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "QUAD:AS01:121:IMIN") field(INPB, "QUAD:AS01:121: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:AS01:121: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:AS01:121:IACT") field(FLNK, "QUAD:AS01:121:IACTPOL") } record(bo, "QUAD:AS01:121:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:AS01:121: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:AS01:121:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:AS01:121:IDELTAS and the\n QUAD:AS01:121: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:AS01:121:IACT: \n Get copy of QUAD:AS01:121:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"QUAD:AS01:121: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:AS01:121:IDES:\n Contains raw value calculated by \nQUAD:AS01:121: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:AS01:121:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"QUAD:AS01:121: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:AS01:121: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:AS01:121: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:AS01:121:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by QUAD:AS01:121:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, QUAD:AS01:121:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n QUAD:AS01:121: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:AS01:121:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:AS01:121:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:AS01:121:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:AS01:121:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:AS01:121:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:AS01:121:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "0") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:AS01:121: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:AS01:121:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:AS01:121:TRIMTYPE.RVAL") field(INPB, "QUAD:AS01:121:CONFIG.RVAL") field(OUT, "QUAD:AS01:121:TRIMMAXNUM PP") } record(longout, "QUAD:AS01:121: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:AS01:121: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, "closed_loop") field(VAL, "1") field(OUT, "QUAD:AS01:121:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:AS01:121: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, "closed_loop") field(VAL, "10") } record(bo, "QUAD:AS01:121: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:AS01:121: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:AS01:121:TRIMSTEPMIN") { field(DESC, "Min step in current") field(DTYP, "Soft Channel") field(DOL, "MCOR:AS01:102:ISTEP") field(PREC, "7") field(EGUF, "10") field(EGUL, "0") field(EGU, "A") field(HOPR, "10") field(LOPR, "0") field(VAL, "0.0001") } record(bo, "QUAD:AS01:121:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "1") } record(ao, "QUAD:AS01:121: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:AS01:121:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:AS01:121: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:AS01:121: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:AS01:121:IMOVE") field(INPB, "QUAD:AS01:121:IACT") field(INPC, "QUAD:AS01:121:IRAMPRATE") field(INPD, "1.0") field(INPE, "QUAD:AS01:121:TRIMDLYPCT") field(INPF, "QUAD:AS01:121:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:AS01:121:RAMPTIME_LEFT PP") } record(longout, "QUAD:AS01:121:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:AS01:121:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:AS01:121:RAMPDONE_CALC") } record(calc, "QUAD:AS01:121:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:AS01:121:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:AS01:121:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:AS01:121: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:AS01:121:RAMPTIME_LEFT") field(OUT, "QUAD:AS01:121:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:AS01:121:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:AS01:121:RAMPTIME_LEFT NMS") field(OUT, "QUAD:AS01:121:RAMPDONE PP") } record(bo, "QUAD:AS01:121:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:AS01:121:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:AS01:121: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:AS01:121: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:AS01:121:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "QUAD:AS01:121:DEBUG.PROC PP") field(LNK2, "QUAD:AS01:121:STDZCYCLENUM.PROC PP") field(LNK3, "QUAD:AS01:121:STDZDISABLE.PROC PP") field(LNK4, "QUAD:AS01:121: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:AS01:121:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "QUAD:AS01:121:STDZIMIN NPP NMS") field(INPB, "QUAD:AS01:121:STDZIMAX NPP NMS") field(INPC, "QUAD:AS01:121:STDZIFINAL NPP NMS") field(INPD, "QUAD:AS01:121:STDZCYCLENUM NPP NMS") field(INPE, "QUAD:AS01:121:STDZDIRECT.RVAL NPP NMS") field(INPF, "QUAD:AS01:121:STDZDISABLE.RVAL CPP NMS") field(INPG, "QUAD:AS01:121: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:AS01:121:STDZWF PP") field(OUTB, "QUAD:AS01:121: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:AS01:121:STDZWF") } record(mbbo, "QUAD:AS01:121: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:AS01:121: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:AS01:121:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "QUAD:AS01:121: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:AS01:121: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:AS01:121: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:AS01:121:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:AS01:121:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "QUAD:AS01:121:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "QUAD:AS01:121: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:AS01:121:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "QUAD:AS01:121:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "QUAD:AS01:121:STDZIMIN") } record(ao, "QUAD:AS01:121:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(VAL, "-6.0") field(FLNK, "QUAD:AS01:121:STDZIMAX") } record(ao, "QUAD:AS01:121:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(VAL, "6.0") field(FLNK, "QUAD:AS01:121:STDZIFINAL") } record(ao, "QUAD:AS01:121:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(VAL, "-6.0") field(FLNK, "QUAD:AS01:121: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:AS01:121: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:AS01:121:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "QUAD:AS01:121:STDZIMIN CP NMS") field(INPB, "QUAD:AS01:121:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "QUAD:AS01:121:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "QUAD:AS01:121:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "QUAD:AS01:121:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "QUAD:AS01:121:STDZIMIN CP NMS") field(INPB, "QUAD:AS01:121:STDZIMAX CP NMS") field(INPC, "QUAD:AS01:121:TRIMRAMPRATE CP NMS") field(INPD, "1.0") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "QUAD:AS01:121:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "QUAD:AS01:121:TRIMDLYPCT CP MS") field(INPB, "QUAD:AS01:121: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:AS01:121: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:AS01:121: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:AS01:121:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "QUAD:AS01:121:IDES.HOPR") field(INPB, "QUAD:AS01:121:STDZMINIPCT CPP NMS") field(INPC, "QUAD:AS01:121:IDES.LOPR") field(PREC, "5") } record(calc, "QUAD:AS01:121:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "QUAD:AS01:121:IDES.HOPR") field(INPB, "QUAD:AS01:121:IDES.LOPR") field(INPC, "QUAD:AS01:121:STDZDIRECT.RVAL") field(INPD, "QUAD:AS01:121:STDZMINIDELTA") field(INPE, "QUAD:AS01:121:IDES") field(PREC, "5") field(FLNK, "QUAD:AS01:121: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:AS01:121:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "QUAD:AS01:121:IDES.HOPR") field(INPB, "QUAD:AS01:121:IDES.LOPR") field(INPC, "QUAD:AS01:121:STDZDIRECT.RVAL") field(INPD, "QUAD:AS01:121:STDZMINIDELTA") field(INPE, "QUAD:AS01:121: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:AS01:121: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:AS01:121:IADJUST.RVAL") field(INPB, "QUAD:AS01:121:STDZDIRECT.RVAL") field(INPC, "QUAD:AS01:121:STDZOK.RVAL") field(INPD, "QUAD:AS01:121:STDZDISABLE.RVAL") field(INPE, "QUAD:AS01:121:STATE.RVAL CPP NMS") field(INPF, "QUAD:AS01:121:ICTRL.RVAL") field(INPG, "QUAD:AS01:121:STATE.SEVR") field(INPH, "QUAD:AS01:121:BDELTAS.M") field(INPI, "QUAD:AS01:121:IACT.SEVR") field(OUT, "QUAD:AS01:121:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "QUAD:AS01:121:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "QUAD:AS01:121:STDZLOSTTOD.PROC") field(LNK2, "QUAD:AS01:121:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "QUAD:AS01:121:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "QUAD:AS01:121:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:AS01:121:IACT CP") field(INPB, "QUAD:AS01:121:STDZIACTMAX") field(EGU, "A") field(FLNK, "QUAD:AS01:121: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:AS01:121:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "QUAD:AS01:121:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:AS01:121:STDZIACTMAX") field(INPB, "QUAD:AS01:121:IACT") field(INPC, "QUAD:AS01:121:IDELTAS.I") field(OUT, "QUAD:AS01:121: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:AS01:121:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "QUAD:AS01:121:STDZOK.RVAL CP") field(INPB, "QUAD:AS01:121:STDZDISABLE.RVAL CP") field(INPC, "QUAD:AS01:121: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:AS01:121: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:AS01:121:CALBOK") { field(DESC, "Successful Calibration") field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "") 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:AS01:121:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "QUAD:AS01:121:CALBOK") field(INPB, "QUAD:AS01:121:CALBDISABLE") field(INPC, "QUAD:AS01:121:CALBSLOPE") field(OOPT, "On Change") field(OUT, "QUAD:AS01:121: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:AS01:121:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "QUAD:AS01:121: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:AS01:121:CALBSLOPE") field(DOL3, "QUAD:AS01:121:CALBOFFSET") field(DOL4, "0") field(DOL5, "0") field(LNK1, "MCOR:AS01:102:VSETPT.DISA PP NMS") field(LNK2, "MCOR:AS01:102:VSETPT.ASLO PP NMS") field(LNK3, "MCOR:AS01:102:VSETPT.AOFF PP NMS") field(LNK4, "MCOR:AS01:102:VSETPT.LINR PP NMS") field(LNK5, "MCOR:AS01:102:VSETPT.DISA PP NMS") # # 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, "MCOR:AS01:102:VSETPT.DISA PP NMS") field(LNK7, "MCOR:AS01:102:VSETPT.ASLO PP NMS") field(LNK8, "MCOR:AS01:102:VSETPT.AOFF PP NMS") field(LNK9, "MCOR:AS01:102:VSETPT.LINR PP NMS") field(LNKA, "MCOR:AS01:102:VSETPT.DISA PP NMS") } record(stringout, "QUAD:AS01:121:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "QUAD:AS01:121: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:AS01:121: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:AS01:121: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:AS01:121:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "QUAD:AS01:121: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:AS01:121:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "MCOR:AS01:102:VSETPT.ESLO") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:AS01:121:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "QUAD:AS01:121:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "MCOR:AS01:102:VSETPT.EOFF") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:AS01:121: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:AS01:121:CALCDAC") { field(DESC, "IACT to DAC Counts") field(CALC, "D=0?0:(((C*A)+B)-E)/D") field(INPA, "MCOR:AS01:102:I2VSLOPE") field(INPB, "0.0") field(INPC, "QUAD:AS01:121:IACT") field(INPD, "QUAD:AS01:121:DACSLOPE") field(INPE, "QUAD:AS01:121:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "QUAD:AS01:121:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "MCOR:AS01:102:VSETPT.RVAL CP") field(OMSL, "closed_loop") field(PREC, "6") field(PINI, "YES") } record(ao, "QUAD:AS01:121:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "6.0") field(HOPR, "6.0") field(DRVL, "-6.0") field(LOPR, "-6.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "QUAD:AS01:121:CALBIMAX") } record(ao, "QUAD:AS01:121:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "6.0") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVL, "-6.0") field(EGU, "A") field(VAL, "6.0") field(FLNK, "QUAD:AS01:121:CALBSTEPNUM") } record(ao, "QUAD:AS01:121:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(VAL, "0") } record(longout, "QUAD:AS01:121: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:AS01:121:CALBIDELTA") } record(calc, "QUAD:AS01:121:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "QUAD:AS01:121:CALBIMAX") field(INPB, "QUAD:AS01:121:CALBIMIN") field(INPC, "QUAD:AS01:121: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:AS01:121:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "MCOR:AS01:102:ISETPT.DRVH") field(INPB, "MCOR:AS01:102:IACT.HOPR") field(INPC, "QUAD:AS01:121:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "QUAD:AS01:121:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "QUAD:AS01:121:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:AS01:121:DACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:AS01:121:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:AS01:121: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:AS01:121:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:AS01:121:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:AS01:121:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:AS01:121: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:AS01:121:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:AS01:121:CALBYSA") } # Used only for xygraph edm plot record(subArray, "QUAD:AS01:121:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:AS01:121:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "QUAD:AS01:121:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:AS01:121:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "QUAD:AS01:121:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "QUAD:AS01:121:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "QUAD:AS01:121:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "QUAD:AS01:121: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:AS01:121:CALBSTEPNUM") field(INPB, "QUAD:AS01:121:CALBIACTWF") field(INPC, "QUAD:AS01:121: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:AS01:121: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:AS01:121:STDZITOL") field(INPH, "QUAD:AS01:121:DACSLOPE") field(INPI, "QUAD:AS01:121: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:AS01:121: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:AS01:121:CALBSTEPNUM") field(INPB, "QUAD:AS01:121:CALBIACTWF") field(INPC, "QUAD:AS01:121:DACWF") field(INPF, "QUAD:AS01:121: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:AS01:121CALBOK 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:AS01:121:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "QUAD:AS01:121:DEGAUSIMIN.PROC PP") field(OUTB, "QUAD:AS01:121:DEGAUSIMAX.PROC PP") field(OUTC, "QUAD:AS01:121:DEGAUSTYPE.PROC PP") field(OUTD, "QUAD:AS01:121:DEGAUSSTEP.PROC PP") field(OUTE, "QUAD:AS01:121:MADNAME.PROC PP") field(OUTF, "QUAD:AS01:121:PSTYPE.PROC PP") field(OUTG, "QUAD:AS01:121: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:AS01:121:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "QUAD:AS01:121:DEGAUSIMIN NPP NMS") field(INPB, "QUAD:AS01:121:DEGAUSIMAX NPP NMS") field(INPC, "QUAD:AS01:121:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "QUAD:AS01:121:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "QUAD:AS01:121:PSTYPE NPP NMS") field(INPG, "QUAD:AS01:121:DEBUG.RVAL NPP NMS") field(INPH, "QUAD:AS01:121: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:AS01:121:DEGAUSWF PP") field(OUTB, "QUAD:AS01:121:DEGAUSMSG PP") field(OUTC, "QUAD:AS01:121: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:AS01:121:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"QUAD:AS01:121: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:AS01:121: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:AS01:121: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:AS01:121: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:AS01:121: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:AS01:121:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(VAL, "-6.0") } record(ao, "QUAD:AS01:121:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(VAL, "6.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:AS01:121: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:AS01:121: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:AS01:121: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:AS01:121: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:AS01:121: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:AS01:121: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:AS01:121:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:AS01:121:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:AS01:121:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:AS01:121:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:AS01:121: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:AS01:121: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:AS01:121: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:AS01:121:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "QUAD:AS01:121:DEGAUS_IMAX") field(INPB, "QUAD:AS01:121:ISETPT") field(INPC, "QUAD:AS01:121:DEGAUSTYPE.RVAL") field(OUT, "QUAD:AS01:121:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "QUAD:AS01:121:DEGAUS_IMAX_UPDATE") } record(seq, "QUAD:AS01:121:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "QUAD:AS01:121:ISETPT") field(LNK1, "QUAD:AS01:121:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "QUAD:AS01:121:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(VAL, "6.0") field(FLNK, "QUAD:AS01:121:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "QUAD:AS01:121:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "QUAD:AS01:121:DEGAUS_IMAX") field(FLNK, "QUAD:AS01:121:DEGAUS_IMAXPOL") } record(bo, "QUAD:AS01:121:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:AS01:121:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "QUAD:AS01:121: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:AS01:121:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "QUAD:AS01:121:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "6.0") field(LOPR, "-6.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "QUAD:AS01:121: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:AS01:121:IACT") field(INPB, "QUAD:AS01:121:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "QUAD:AS01:121:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "QUAD:AS01:121:IACTPOL") } record(bo, "QUAD:AS01:121: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:AS01:121: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:AS01:121:DEGAUSENABLE CP") field(INPB, "QUAD:AS01:121:DEGAUSOK") field(INPC, "QUAD:AS01:121:STATE CP") field(INPD, "QUAD:AS01:121:STATE.SEVR") field(OUT, "QUAD:AS01:121:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "QUAD:AS01:121:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "QUAD:AS01:121:DEGAUS_STATE_CHECK") field(LNK1, "QUAD:AS01:121:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "QUAD:AS01:121:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "QUAD:AS01:121:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "QUAD:AS01:121: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:AS01:121:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "QUAD:AS01:121:DEGAUSOK.ZSV") field(LNK2, "QUAD:AS01:121: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:AS01:121:STATMSG.FRSV") field(LNK4, "QUAD:AS01:121: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:AS01:121:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "QUAD:AS01:121:DEGAUSOK.ZSV") field(LNK2, "QUAD:AS01:121: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:AS01:121:STATMSG.FRSV") field(LNK4, "QUAD:AS01:121: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:AS01:121:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "QUAD:AS01:121: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:AS01:121:STATMSG.FRSV") field(LNK3, "QUAD:AS01:121: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:AS01:121:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "QUAD:AS01:121: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:AS01:121:STATMSG.FRSV PP") field(LNK3, "QUAD:AS01:121:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "QUAD:AS01:121:FUNC") { field(DESC, "QUAD:AS01:121 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, "0") field(NIVL, "0") field(TEVL, "0") field(ELVL, "5") field(TVVL, "6") field(TTVL, "7") field(FTVL, "4") field(FFVL, "3") field(OUT, "QUAD:AS01:121:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "QUAD:AS01:121:CTRL") { field(DESC, "QUAD:AS01:121 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, "") field(TVST, "") field(TTST, "") 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, "0") field(TVVL, "0") field(TTVL, "0") field(FTVL, "0") field(FFVL, "0") field(OUT, "QUAD:AS01:121:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "QUAD:AS01:121:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "QUAD:AS01:121:BUSY") } # Set to FREE on IOC reboot record(bo, "QUAD:AS01:121:BUSY") { field(DESC, "QUAD:AS01:121 Ctrl Done") field(DOL, "QUAD:AS01:121:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "QUAD:AS01:121:SELECT") } record(bo, "QUAD:AS01:121:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "QUAD:AS01:121: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:AS01:121:CTRLSTATE") { field(DESC, "QUAD:AS01:121 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:AS01:121:CTRL",20,20,0,0,"QUAD:AS01:121:CTRL") #! Field("QUAD:AS01:121:CTRL.OUT",16777215,1,"QUAD:AS01:121:CTRL.OUT") #! Link("QUAD:AS01:121:CTRL.OUT","QUAD:AS01:121:SELECTEN.A") #! Field("QUAD:AS01:121:CTRL.VAL",16777215,1,"QUAD:AS01:121:CTRL.VAL") #! Record("QUAD:AS01:121:SELECTEN",321,381,0,0,"QUAD:AS01:121:SELECTEN") #! Field("QUAD:AS01:121:SELECTEN.A",16777215,0,"QUAD:AS01:121:SELECTEN.A") #! Field("QUAD:AS01:121:SELECTEN.FLNK",16777215,1,"QUAD:AS01:121:SELECTEN.FLNK") #! Link("QUAD:AS01:121:SELECTEN.FLNK","QUAD:AS01:121:BUSY") #! Field("QUAD:AS01:121:SELECTEN.VAL",16777215,1,"QUAD:AS01:121:SELECTEN.VAL") #! Record("QUAD:AS01:121:BUSY",623,274,0,0,"QUAD:AS01:121:BUSY") #! Field("QUAD:AS01:121:BUSY.DOL",16777215,0,"QUAD:AS01:121:BUSY.DOL") #! Link("QUAD:AS01:121:BUSY.DOL","QUAD:AS01:121:SELECTEN.VAL") #! Field("QUAD:AS01:121:BUSY.FLNK",16777215,1,"QUAD:AS01:121:BUSY.FLNK") #! Link("QUAD:AS01:121:BUSY.FLNK","QUAD:AS01:121:SELECT") #! Record("QUAD:AS01:121:SELECT",669,508,0,1,"QUAD:AS01:121:SELECT") #! Record("QUAD:AS01:121:FUNC",940,120,0,0,"QUAD:AS01:121:FUNC") #! Field("QUAD:AS01:121:FUNC.OUT",16777215,0,"QUAD:AS01:121:FUNC.OUT") #! Link("QUAD:AS01:121:FUNC.OUT","QUAD:AS01:121:CTRL.VAL") #! Record("QUAD:AS01:121:ABORT",193,41,0,0,"QUAD:AS01:121:ABORT") #! Record("QUAD:AS01:121:CTRLSTATE",369,34,0,0,"QUAD:AS01:121: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:AS01:121:SELECT is used for Multi-device selection.\nIt is enabled when associated QUAD:AS01:121:CTRL is \"0\" (DONE).\nIt is disabled when associated QUAD:AS01:121: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:AS01:121: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:AS01:121:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "QUAD:AS01:121:BCTRL.SEVR") field(OUT, "QUAD:AS01:121: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:AS01:121:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:AS01:121:BACT") field(INPB, "QUAD:AS01:121:POLYCOEF") field(INPC, "QUAD:AS01:121:POLYCOEF.A") field(INPD, "QUAD:AS01:121:POLYCOEF.B") field(INPE, "QUAD:AS01:121:IACT MS") field(INPF, "QUAD:AS01:121:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "13.2") field(LOPR, "-13.2") field(HIHI, "13.2") field(LOLO, "-13.2") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "13.2") field(LOW, "-13.2") field(FLNK, "QUAD:AS01:121: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:AS01:121: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:AS01:121:BDES") field(INPB, "QUAD:AS01:121:TRIMBTOL") field(INPC, "QUAD:AS01:121:TRIMBTOLR") field(INPD, "QUAD:AS01:121:CHCKBTOL") field(INPE, "QUAD:AS01:121:CHCKBTOLR") field(F, "0.0") field(INPG, "30") field(INPH, "QUAD:AS01:121:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "QUAD:AS01:121:MPSBTOL") field(INPQ, "QUAD:AS01:121:MPSBTOLR") field(FLNK, "QUAD:AS01:121:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "QUAD:AS01:121:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "QUAD:AS01:121:BDES") field(INPB, "QUAD:AS01:121:BDELTAS.I") field(INPG, "QUAD:AS01:121:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "QUAD:AS01:121:BCON.HIGH") field(OUTB, "QUAD:AS01:121:BCON.LOW") field(OUTC, "QUAD:AS01:121:BCON.HIHI") field(OUTD, "QUAD:AS01:121:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "QUAD:AS01:121:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "QUAD:AS01:121:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "QUAD:AS01:121:BDIFF") field(LNK2, "QUAD:AS01:121:BADIFF") field(LNK3, "QUAD:AS01:121:BRATIO") field(LNK4, "QUAD:AS01:121:MPSLIMITS") field(LNK5, "QUAD:AS01:121:I2BSTATUS") field(LNK6, "QUAD:AS01:121:IACTFO.PROC") } record(calc, "QUAD:AS01:121:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "QUAD:AS01:121:BDES") field(INPB, "QUAD:AS01:121:BACT") field(EGU, "kG") field(PREC, "7") } record(calc, "QUAD:AS01:121:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "QUAD:AS01:121:BDIFF") field(EGU, "kG") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "QUAD:AS01:121:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "QUAD:AS01:121:BDIFF") field(INPB, "QUAD:AS01:121:BDES.HOPR") field(EGU, "kG") field(PREC, "7") } record(mbbi, "QUAD:AS01:121: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:AS01:121:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "QUAD:AS01:121:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:AS01:121:BMON") field(INPB, "QUAD:AS01:121:POLYCOEF") field(INPC, "QUAD:AS01:121:POLYCOEF.A") field(INPD, "QUAD:AS01:121:POLYCOEF.B") field(INPE, "QUAD:AS01:121:IMON MS") field(INPF, "QUAD:AS01:121:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG") field(HOPR, "13.2") field(LOPR, "-13.2") field(HIHI, "13.2") field(LOLO, "-13.2") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "13.2") field(LOW, "-13.2") } # 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=MCOR:AS01:102:BDES CP record(ao, "QUAD:AS01:121:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "13.2") field(DRVL, "-13.2") field(HOPR, "13.2") field(LOPR, "-13.2") field(PREC, "7") field(EGU, "kG") field(MDEL, "-1") field(OMSL, "supervisory") # field(DOL, "") field(OUT, "QUAD:AS01:121:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "QUAD:AS01:121:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:AS01:121:POLYCOEF") field(INPC, "QUAD:AS01:121:POLYCOEF.A") field(INPD, "QUAD:AS01:121:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "13.2") field(LOPR, "-13.2") field(MDEL, "-1") field(INPE, "QUAD:AS01:121:BDES.DRVH") field(INPF, "QUAD:AS01:121:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:AS01:121:IDES") } record(sub, "QUAD:AS01:121:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:AS01:121:POLYCOEF") field(INPC, "QUAD:AS01:121:POLYCOEF.A") field(INPD, "QUAD:AS01:121:POLYCOEF.B") field(INPE, "QUAD:AS01:121:BDES.DRVH") field(INPF, "QUAD:AS01:121:BDES.DRVL") field(EGU, "kG") field(HOPR, "13.2") field(LOPR, "-13.2") field(PREC, "7") field(VAL, "0.0") field(FLNK, "QUAD:AS01:121:INOM") } record(sub, "QUAD:AS01:121:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:AS01:121:BDES.VAL") field(INPB, "QUAD:AS01:121:BDES.DRVH") field(INPC, "QUAD:AS01:121:BDES.DRVL") field(INPD, "QUAD:AS01:121:BDELTAS.I") field(INPE, "QUAD:AS01:121:BDELTAS.J") field(INPG, "QUAD:AS01:121:STATE") field(INPH, "QUAD:AS01:121:HSTA") field(EGU, "kG") field(HOPR, "13.2") field(LOPR, "-13.2") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "QUAD:AS01:121:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:AS01:121:BDES.VAL") field(INPB, "QUAD:AS01:121:BDES.DRVH") field(INPC, "QUAD:AS01:121:BDES.DRVL") field(INPD, "QUAD:AS01:121:BDELTAS.K") field(INPE, "QUAD:AS01:121:BDELTAS.L") field(INPG, "QUAD:AS01:121:STATE") field(INPH, "QUAD:AS01:121:HSTA") field(EGU, "kG") field(HOPR, "13.2") field(LOPR, "-13.2") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "QUAD:AS01:121:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "QUAD:AS01:121:BLIMITS") field(LNK1, "QUAD:AS01:121:BACTLIMITS.F PP") field(DOL2, "QUAD:AS01:121:BACTLIMITS.I") field(LNK2, "QUAD:AS01:121:BACT.HIGH") field(DOL3, "QUAD:AS01:121:BACTLIMITS.J") field(LNK3, "QUAD:AS01:121:BACT.LOW") field(DOL4, "QUAD:AS01:121:BACTLIMITS.K") field(LNK4, "QUAD:AS01:121:BACT.HIHI") field(DOL5, "QUAD:AS01:121:BACTLIMITS.L") field(LNK5, "QUAD:AS01:121:BACT.LOLO") field(DOL6, "QUAD:AS01:121:BLIMITS") field(LNK6, "QUAD:AS01:121:BMONLIMITS.F PP") field(DOL7, "QUAD:AS01:121:BMONLIMITS.I") field(LNK7, "QUAD:AS01:121:BMON.HIGH") field(DOL8, "QUAD:AS01:121:BMONLIMITS.J") field(LNK8, "QUAD:AS01:121:BMON.LOW") field(DOL9, "QUAD:AS01:121:BMONLIMITS.K") field(LNK9, "QUAD:AS01:121:BMON.HIHI") field(DOLA, "QUAD:AS01:121:BMONLIMITS.L") field(LNKA, "QUAD:AS01:121:BMON.LOLO") field(FLNK, "QUAD:AS01:121:ILIMITS") field(SCAN, "5 second") } record(ao, "QUAD:AS01:121:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG") field(DRVH, "13.2") field(DRVL, "-13.2") field(HOPR, "13.2") field(LOPR, "-13.2") # 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:AS01:121: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:AS01:121:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "QUAD:AS01:121:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "QUAD:AS01:121:BCTRL.VAL") field(LNK2, "QUAD:AS01:121:BDES PP") field(DOL3, "1") field(LNK3, "QUAD:AS01:121:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "QUAD:AS01:121:CHECKSTDZLOST.PROC PP") field(DOL5, "QUAD:AS01:121:BCTRL.VAL") field(LNK5, "QUAD:AS01:121:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "QUAD:AS01:121:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "QUAD:AS01:121:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:AS01:121:POLYCOEF") field(INPC, "QUAD:AS01:121:POLYCOEF.A") field(INPD, "QUAD:AS01:121:POLYCOEF.B") field(INPE, "QUAD:AS01:121:BDES.DRVH") field(INPF, "QUAD:AS01:121:BDES.DRVL") field(PREC, "7") field(EGU, "kG") field(HOPR, "13.2") field(LOPR, "-13.2") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "QUAD:AS01:121:ISETPT") } record(ao, "QUAD:AS01:121:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "13.2") field(DRVL, "-13.2") field(EGU, "kG") field(HOPR, "13.2") field(LOPR, "-13.2") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "QUAD:AS01:121:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "CQ01S") } record(ai, "QUAD:AS01:121: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, "2018.072") } record(ao, "QUAD:AS01:121:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "13.2") field(DRVL, "-13.2") field(EGU, "kG") field(HOPR, "13.2") field(LOPR, "-13.2") field(PREC, "7") field(PINI, "YES") field(VAL, "13.2") field(FLNK, "QUAD:AS01:121:BSTEP") } record(ao, "QUAD:AS01:121:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "13.2") field(DRVL, "-13.2") field(EGU, "kG") field(HOPR, "13.2") field(LOPR, "-13.2") field(PREC, "7") field(PINI, "YES") field(VAL, "-13.2") field(FLNK, "QUAD:AS01:121:BSTEP") } record(ao, "QUAD:AS01:121:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "13.2") field(DRVL, "-13.2") field(EGU, "kG") field(HOPR, "13.2") field(LOPR, "-13.2") field(PINI, "YES") field(PREC, "7") } # This record is processed by QUAD:AS01:121: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:AS01:121:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG") field(HOPR, "13.2") field(LOPR, "-13.2") field(DRVH, "13.2") field(DRVL, "-13.2") # 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:AS01:121:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "QUAD:AS01:121:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:AS01:121:POLYCOEF") field(INPC, "QUAD:AS01:121:POLYCOEF.A") field(INPD, "QUAD:AS01:121:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "13.2") field(LOPR, "-13.2") field(MDEL, "-1") field(INPE, "QUAD:AS01:121:BCON.DRVH") field(INPF, "QUAD:AS01:121:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:AS01:121: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:AS01:121:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "QUAD:AS01:121:BMAX") field(INPB, "QUAD:AS01:121:BMIN") field(INPC, "QUAD:AS01:121:BMIN.SEVR") field(INPD, "QUAD:AS01:121: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:AS01:121:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "QUAD:AS01:121:ONLINE CP") field(OUT, "QUAD:AS01:121:BCTRLDISABLEFOUT PP") } record(fanout, "QUAD:AS01:121:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "QUAD:AS01:121:BCTRLDISABLECALC") field(LNK1, "QUAD:AS01:121:BCTRLDISABLE") field(LNK2, "QUAD:AS01:121:BCTRLENABLE") } record(stringout, "QUAD:AS01:121:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:AS01:121:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "QUAD:AS01:121:BCTRLDISV_UPDATE") } record(stringout, "QUAD:AS01:121:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:AS01:121:BCTRL.ASG") field(VAL, "") field(FLNK, "QUAD:AS01:121:BCTRLDISV_UPDATE") } record(calcout, "QUAD:AS01:121:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "QUAD:AS01:121:ONLINE") field(OUT, "QUAD:AS01:121: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:AS01:121:BACT and MON\n are processed via links from \n QUAD:AS01:121:IACT (device raw value readback 1)\n and\n QUAD:AS01:121: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:AS01:121:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = QUAD:AS01:121: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:AS01:121:BDES\n is processed when set by CA users or \n QUAD:AS01:121: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:AS01:121: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:AS01:121: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:AS01:121: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:AS01:121:B*LIMITS and QUAD:AS01:121:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:AS01:121: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:AS01:121: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:AS01:121: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:AS01:121: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:AS01:121:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "QUAD:AS01:121:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "QUAD:AS01:121:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "13.2") field(DRVL, "-13.2") field(PINI, "YES") field(VAL, "13.2") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:AS01:121:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "13.2") field(DRVL, "-13.2") field(PINI, "YES") field(VAL, "-13.2") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:AS01:121:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "13.2") field(DRVL, "-13.2") field(PINI, "YES") field(VAL, "-13.2") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:AS01:121:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "13.2") field(DRVL, "-13.2") field(PINI, "YES") field(VAL, "-13.2") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "QUAD:AS01:121: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:AS01:121:MPSLIMITS.E PP") } record(aSub, "QUAD:AS01:121: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:AS01:121:MPS.RVAL") field(INPB, "QUAD:AS01:121:BADIFF") field(INPC, "QUAD:AS01:121:BDELTAS.N") field(INPD, "QUAD:AS01:121:BACT") field(INPE, "QUAD:AS01:121:MPSBITMASK.RVAL") field(INPF, "QUAD:AS01:121:MPSBLLIM") field(INPG, "QUAD:AS01:121:MPSBMIN") field(INPH, "QUAD:AS01:121:MPSBMAX") field(INPI, "QUAD:AS01:121: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:AS01:121:INTOL.RVAL PP") field(OUTB, "QUAD:AS01:121:INTOL_BMIN.RVAL PP") field(OUTC, "QUAD:AS01:121:INTOL_BRANGE.RVAL PP") field(OUTD, "QUAD:AS01:121: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:AS01:121:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:AS01:121:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:AS01:121:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:AS01:121:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:AS01:121:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:AS01:121:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:AS01:121:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:AS01:121: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:AS01:121:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "QUAD:AS01:121:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "QUAD:AS01:121:CHCKBTOL") field(INPB, "QUAD:AS01:121:POLYCOEF.B") field(PREC, "9") } record(calc, "QUAD:AS01:121: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:AS01:121:CHCKBTOL") field(FLNK, "QUAD:AS01:121:CHCKITOL") } record(calc, "QUAD:AS01:121:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "QUAD:AS01:121:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "QUAD:AS01:121:BDES.HOPR") field(INPB, "QUAD:AS01:121:STABILITY") field(INPC, "QUAD:AS01:121:BDES.LOPR") } record(longout, "QUAD:AS01:121:STABILITY") { field(DESC, "Long Term Stability") field(PINI, "YES") field(VAL, "1000") field(EGU, "ppm") field(DRVH, "3000") field(DRVL, "100") field(HOPR, "3000") field(LOPR, "100") field(FLNK, "QUAD:AS01:121:CHCKBTOL") } record(calc, "QUAD:AS01:121:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG") field(CALC, "ABS(A*B)") field(INPA, "QUAD:AS01:121:POLYCOEF.B") field(INPB, "QUAD:AS01:121:TRIMBTOL") field(PREC, "9") } record(ai, "QUAD:AS01:121: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:AS01:121: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:AS01:121:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "QUAD:AS01:121:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "QUAD:AS01:121:PAUGO") } record(fanout, "QUAD:AS01:121:PAUGO") { field(DESC, "PAU control") field(LNK1, "QUAD:AS01:121:PAUSTOP") field(LNK2, "QUAD:AS01:121: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:AS01:121:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "QUAD:AS01:121:PAU.RVAL") field(DISV, "0") field(DOL1, "0") field(DOL2, "0") field(DOL3, "1") field(DLY3, "1") # field(LNK1, "MCOR:AS01:102:ISETPT.DISV") # field(LNK2, "MCOR:AS01:102:VSETPT.DISV") # field(LNK3, "ACTPAU PP") } record(seq, "QUAD:AS01:121:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "QUAD:AS01:121:PAU.RVAL") field(DISV, "1") field(DOL1, "1") field(DOL2, "1") field(DOL3, "0") # field(LNK1, "MCOR:AS01:102:ISETPT.DISV") # field(LNK2, "MCOR:AS01:102:VSETPT.DISV") # field(LNK3, "ACTPAU PP") } # Change attribute to PSDEVNAME record(stringout, "QUAD:AS01:121:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "MCOR:AS01:102:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:AS01:121: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:AS01:121:PSTYPE.RVAL") field(INPC, "QUAD:AS01:121:TURNEDOFF.RVAL") field(INPD, "QUAD:AS01:121:CONFIG.RVAL") field(INPE, "QUAD:AS01:121:PSCATEGORY.RVAL") field(INPF, "QUAD:AS01:121:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:AS01:121:AUTOCTRL.RVAL") field(INPJ, "QUAD:AS01:121:OUTOFSERVICE.RVAL") field(INPL, "QUAD:AS01:121:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:AS01:121:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:AS01:121:PAU") field(INPP, "QUAD:AS01:121:CALBDISABLE.RVAL") field(INPQ, "QUAD:AS01:121:PTRBDISABLE.RVAL") field(INPR, "QUAD:AS01:121:TRIMDISABLE.RVAL") field(INPS, "QUAD:AS01:121:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:AS01:121:FBCK") field(INPU, "QUAD:AS01:121:TRIMTYPE.RVAL") field(INPV, "QUAD:AS01:121:STDZDIRECT.RVAL") field(INPW, "QUAD:AS01:121:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:AS01:121:HSTA") } record(longin, "QUAD:AS01:121:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:AS01:121:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:AS01:121: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:AS01:121: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:AS01:121: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:AS01:121: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:AS01:121: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:AS01:121: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:AS01:121:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:AS01:121:FBCK. # This PV should be replaced by QUAD:AS01:121: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:AS01:121: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:AS01:121: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:AS01:121: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:AS01:121:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:AS01:121:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:AS01:121:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:AS01:121:ONLINE PP") } record(bo, "QUAD:AS01:121:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:AS01:121: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:AS01:121: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:AS01:121: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:AS01:121: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:AS01:121: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:AS01:121: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:AS01:121: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:AS01:121: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, "QUAD:AS01:121: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, "0") field(ASG, "NOWRITE") } record(mbbo, "QUAD:AS01:121: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, "0") field(ASG, "NOWRITE") } record(mbbo, "QUAD:AS01:121: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:AS01:121:TRIMTYPE") } record(stringout, "QUAD:AS01:121:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:AS01:121:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:AS01:121:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:AS01:121:STATE.RVAL") field(INPB, "QUAD:AS01:121:INTLKSUMY.RVAL") field(OUT, "QUAD:AS01:121:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:AS01:121: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:AS01:121:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:AS01:121:STATE.RVAL") field(INPB, "QUAD:AS01:121:INTLKSUMY.RVAL") field(OUT, "QUAD:AS01:121:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:AS01:121:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:AS01:121:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:AS01:121: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:AS01:121: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:AS01:121: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:AS01:121: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:AS01:121: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:AS01:121:TURNEDOFF",3140,1907,0,1,"QUAD:AS01:121:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:AS01:121:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "QUAD:AS01:121:BACT.STAT") field(INPB, "QUAD:AS01:121:BDES.STAT") field(INPC, "QUAD:AS01:121:IRIPL.STAT") field(INPD, "MCOR:AS01:102:VSETPT.STAT") field(INPE, "MCOR:AS01:102:VACT.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:AS01:121:BACT.SEVR") field(INPH, "QUAD:AS01:121:BDES.SEVR") field(INPI, "QUAD:AS01:121:IRIPL.SEVR") field(INPJ, "MCOR:AS01:102:VSETPT.SEVR") field(INPK, "MCOR:AS01:102:VACT.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:AS01:121:STATE.RVAL") field(INPN, "QUAD:AS01:121:STDZOK") field(INPO, "QUAD:AS01:121:CALBOK") field(INPP, "QUAD:AS01:121:OUTOFSERVICE.RVAL") field(INPQ, "QUAD:AS01:121:CONFIG.RVAL") field(INPR, "QUAD:AS01:121:HSTA") field(INPS, "QUAD:AS01:121:CTRL.RVAL") field(INPT, "QUAD:AS01:121:DEGAUSOK") field(INPV, "QUAD:AS01:121: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:AS01:121:STAT") } record(longout, "QUAD:AS01:121:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "QUAD:AS01:121:STATCTRLSUB") field(DOL, "QUAD:AS01:121:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "QUAD:AS01:121:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "QUAD:AS01:121:STAT") field(INPB, "QUAD:AS01:121:HSTA") field(INPD, "QUAD:AS01:121:ONOFFCTRL.RVAL") field(FLNK, "QUAD:AS01:121:STATMSG") } record(mbbo, "QUAD:AS01:121: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:AS01:121:UNAVAILGO") field(DOL, "QUAD:AS01:121:STATCTRLSUB.W") } record(seq, "QUAD:AS01:121:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "QUAD:AS01:121:STATSUB.U") field(LNK1, "QUAD:AS01:121:UNAVAIL PP") } record(stringout, "QUAD:AS01:121:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"QUAD:AS01:121:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - QUAD:AS01:121:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - QUAD:AS01:121: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:AS01:121STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - QUAD:AS01:121:STATUS\nC - QUAD:AS01:121:ON\nD - QUAD:AS01:121:STDZOK\nE - QUAD:AS01:121:CALBOK\nF - QUAD:AS01:121:BACTDRIFT (future)\nG -\nH- QUAD:AS01:121:DACSTATUS\nI -QUAD:AS01:121:ADCSTATUS\nJ - QUAD:AS01:121:BACTSTATUS\nK - QUAD:AS01:121:BDESSTATUS\nL - QUAD:AS01:121:RIPLSTATUS\n\nOutput:\nP - QUAD:AS01:121: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:AS01:121: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:AS01:121: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:AS01:121: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:AS01:121: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 # Note: for slave with trim coils # set the macro ACT to the following: # ACT=:IACTCALC record(ai, "QUAD:AS01:122:IACT") { field(DESC, "Current") field(INP, "MCOR:AS01:103:IACT") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:AS01:122:BACT") info(autosaveFields,"HYST") } record(bi, "QUAD:AS01:122:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "MCOR:AS01:103:STATE NPP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "QUAD:AS01:122:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "6.0") field(LOLO, "-6.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:AS01:122:BDELTAS") field(DRVH, "6.0") field(DRVL, "-6.0") field(DOL, "QUAD:AS01:122: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:AS01:122:ICTRL PP") } # This record is processed by QUAD:AS01:122:ICON") # Note: we are not setting alarms here. record(ao, "QUAD:AS01:122:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(DOL, "QUAD:AS01:122:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "QUAD:AS01:122:INOM") { field(DESC, "Nominal Current") field(DOL, "QUAD:AS01:122:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "6.0") field(DRVL, "-6.0") field(HOPR, "6.0") field(LOPR, "-6.0") } record(ao, "QUAD:AS01:122:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(MDEL, "-1") field(FLNK, "QUAD:AS01:122:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "QUAD:AS01:122:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "QUAD:AS01:122:ISETPT.OMSL") field(DOL2, "QUAD:AS01:122:ICTRL") field(LNK2, "QUAD:AS01:122:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "QUAD:AS01:122:ISETPT.OMSL") } record(ao, "QUAD:AS01:122:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "6.0") field(DRVL, "-6.0") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(PINI, "YES") field(VAL, "6.0") field(FLNK, "QUAD:AS01:122:IMIN") } record(ao, "QUAD:AS01:122:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "6.0") field(DRVL, "-6.0") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(VAL, "-6.0") field(FLNK, "QUAD:AS01:122:IRANGE") } record(sel, "QUAD:AS01:122:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(NVL, "QUAD:AS01:122:BACT.SEVR") field(INPA, "QUAD:AS01:122:IACT NPP MS") field(INPB, "QUAD:AS01:122:IACTPREVOK NPP MS") field(INPC, "QUAD:AS01:122:IACTPREVOK NPP MS") field(INPD, "QUAD:AS01:122:IACTPREVOK NPP MS") } record(sub, "QUAD:AS01:122:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:AS01:122:IDES") field(INPB, "QUAD:AS01:122:ISETPT.DRVH") field(INPC, "QUAD:AS01:122:ISETPT.DRVL") field(INPD, "QUAD:AS01:122:IDELTAS.I") field(INPE, "QUAD:AS01:122:IDELTAS.J") field(INPG, "QUAD:AS01:122:STATE") field(INPH, "QUAD:AS01:122:HSTA") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "QUAD:AS01:122:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:AS01:122:IDES") field(INPB, "QUAD:AS01:122:ISETPT.DRVH") field(INPC, "QUAD:AS01:122:ISETPT.DRVL") field(INPD, "QUAD:AS01:122:IDELTAS.K") field(INPE, "QUAD:AS01:122:IDELTAS.L") field(INPG, "QUAD:AS01:122:STATE") field(INPH, "QUAD:AS01:122:HSTA") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "QUAD:AS01:122:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "QUAD:AS01:122:BLIMITS") field(LNK1, "QUAD:AS01:122:IACTLIMITS.F PP") field(DOL2, "QUAD:AS01:122:IACTLIMITS.I") field(LNK2, "QUAD:AS01:122:IACT.HIGH") field(DOL3, "QUAD:AS01:122:IACTLIMITS.J") field(LNK3, "QUAD:AS01:122:IACT.LOW") field(DOL4, "QUAD:AS01:122:IACTLIMITS.K") field(LNK4, "QUAD:AS01:122:IACT.HIHI") field(DOL5, "QUAD:AS01:122:IACTLIMITS.L") field(LNK5, "QUAD:AS01:122:IACT.LOLO") field(DOL6, "QUAD:AS01:122:BLIMITS") field(LNK6, "QUAD:AS01:122:IMONLIMITS.F PP") field(DOL7, "QUAD:AS01:122:IMONLIMITS.I") field(LNK7, "QUAD:AS01:122:IMON.HIGH") field(DOL8, "QUAD:AS01:122:IMONLIMITS.J") field(LNK8, "QUAD:AS01:122:IMON.LOW") field(DOL9, "QUAD:AS01:122:IMONLIMITS.K") field(LNK9, "QUAD:AS01:122:IMON.HIHI") field(DOLA, "QUAD:AS01:122:IMONLIMITS.L") field(LNKA, "QUAD:AS01:122: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:AS01:122:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "QUAD:AS01:122:TRIMBTOL") field(INPE, "QUAD:AS01:122:CHCKBTOL") field(INPF, "QUAD:AS01:122:BDELTAS.K") field(INPG, "QUAD:AS01:122:BDELTAS.L") field(INPH, "QUAD:AS01:122: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:AS01:122:STDZITOLR") field(INPC, "QUAD:AS01:122:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = MCOR:AS01:103: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:AS01:122: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 = MCOR:AS01:103:RESET PP # record(bo, "QUAD:AS01:122:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "MCOR:AS01:103:RESET PP") } record(bo, "QUAD:AS01:122:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "") 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:AS01:122: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:AS01:122:TRIMRAMPRATE") field(OUT, "") field(FLNK, "QUAD:AS01:122:STDZDLY") } record(ao, "QUAD:AS01:122:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(MDEL, "-1") field(OUT, "MCOR:AS01:103:ISETPT PP") field(DOL, "QUAD:AS01:122: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:AS01:122:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:AS01:122:BMON") } record(ao, "QUAD:AS01:122:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "QUAD:AS01:122:IRIPLOK") } record(sub, "QUAD:AS01:122:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "QUAD:AS01:122:IRIPL.VAL") field(INPB, "QUAD:AS01:122: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:AS01:122: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, "QUAD:AS01:122:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") } record(bi, "QUAD:AS01:122:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "MCOR:AS01:103:INTLKSUMY NPP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "QUAD:AS01:122: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, "MCOR:AS01:103:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "QUAD:AS01:122:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "QUAD:AS01:122:IACTPREVOK") field(LNK2, "QUAD:AS01:122:IDIFF") field(LNK3, "QUAD:AS01:122:IADIFF") field(LNK4, "QUAD:AS01:122:IRATIO") field(LNK5, "QUAD:AS01:122:IDIRECT") field(LNK6, "QUAD:AS01:122:IACTPOL_CHECK") } record(calc, "QUAD:AS01:122:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "QUAD:AS01:122:IDES") field(INPB, "QUAD:AS01:122:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "6.0") field(LOPR, "-6.0") } record(calc, "QUAD:AS01:122:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "QUAD:AS01:122:IDIFF") field(PREC, "9") } record(calc, "QUAD:AS01:122:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "QUAD:AS01:122:IDIFF") field(INPB, "QUAD:AS01:122:IDES.DRVH") field(PREC, "9") } record(calcout, "QUAD:AS01:122:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "QUAD:AS01:122:IMIN") field(INPB, "QUAD:AS01:122: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:AS01:122: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:AS01:122:IACT") field(FLNK, "QUAD:AS01:122:IACTPOL") } record(bo, "QUAD:AS01:122:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:AS01:122: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:AS01:122:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:AS01:122:IDELTAS and the\n QUAD:AS01:122: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:AS01:122:IACT: \n Get copy of QUAD:AS01:122:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"QUAD:AS01:122: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:AS01:122:IDES:\n Contains raw value calculated by \nQUAD:AS01:122: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:AS01:122:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"QUAD:AS01:122: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:AS01:122: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:AS01:122: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:AS01:122:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by QUAD:AS01:122:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, QUAD:AS01:122:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n QUAD:AS01:122: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:AS01:122:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:AS01:122:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:AS01:122:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:AS01:122:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:AS01:122:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:AS01:122:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "0") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:AS01:122: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:AS01:122:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:AS01:122:TRIMTYPE.RVAL") field(INPB, "QUAD:AS01:122:CONFIG.RVAL") field(OUT, "QUAD:AS01:122:TRIMMAXNUM PP") } record(longout, "QUAD:AS01:122: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:AS01:122: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, "closed_loop") field(VAL, "1") field(OUT, "QUAD:AS01:122:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:AS01:122: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, "closed_loop") field(VAL, "10") } record(bo, "QUAD:AS01:122: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:AS01:122: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:AS01:122:TRIMSTEPMIN") { field(DESC, "Min step in current") field(DTYP, "Soft Channel") field(DOL, "MCOR:AS01:103:ISTEP") field(PREC, "7") field(EGUF, "10") field(EGUL, "0") field(EGU, "A") field(HOPR, "10") field(LOPR, "0") field(VAL, "0.0001") } record(bo, "QUAD:AS01:122:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "1") } record(ao, "QUAD:AS01:122: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:AS01:122:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:AS01:122: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:AS01:122: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:AS01:122:IMOVE") field(INPB, "QUAD:AS01:122:IACT") field(INPC, "QUAD:AS01:122:IRAMPRATE") field(INPD, "1.0") field(INPE, "QUAD:AS01:122:TRIMDLYPCT") field(INPF, "QUAD:AS01:122:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:AS01:122:RAMPTIME_LEFT PP") } record(longout, "QUAD:AS01:122:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:AS01:122:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:AS01:122:RAMPDONE_CALC") } record(calc, "QUAD:AS01:122:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:AS01:122:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:AS01:122:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:AS01:122: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:AS01:122:RAMPTIME_LEFT") field(OUT, "QUAD:AS01:122:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:AS01:122:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:AS01:122:RAMPTIME_LEFT NMS") field(OUT, "QUAD:AS01:122:RAMPDONE PP") } record(bo, "QUAD:AS01:122:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:AS01:122:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:AS01:122: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:AS01:122: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:AS01:122:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "QUAD:AS01:122:DEBUG.PROC PP") field(LNK2, "QUAD:AS01:122:STDZCYCLENUM.PROC PP") field(LNK3, "QUAD:AS01:122:STDZDISABLE.PROC PP") field(LNK4, "QUAD:AS01:122: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:AS01:122:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "QUAD:AS01:122:STDZIMIN NPP NMS") field(INPB, "QUAD:AS01:122:STDZIMAX NPP NMS") field(INPC, "QUAD:AS01:122:STDZIFINAL NPP NMS") field(INPD, "QUAD:AS01:122:STDZCYCLENUM NPP NMS") field(INPE, "QUAD:AS01:122:STDZDIRECT.RVAL NPP NMS") field(INPF, "QUAD:AS01:122:STDZDISABLE.RVAL CPP NMS") field(INPG, "QUAD:AS01:122: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:AS01:122:STDZWF PP") field(OUTB, "QUAD:AS01:122: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:AS01:122:STDZWF") } record(mbbo, "QUAD:AS01:122: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:AS01:122: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:AS01:122:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "QUAD:AS01:122: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:AS01:122: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:AS01:122: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:AS01:122:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:AS01:122:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "QUAD:AS01:122:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "QUAD:AS01:122: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:AS01:122:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "QUAD:AS01:122:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "QUAD:AS01:122:STDZIMIN") } record(ao, "QUAD:AS01:122:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(VAL, "-6.0") field(FLNK, "QUAD:AS01:122:STDZIMAX") } record(ao, "QUAD:AS01:122:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(VAL, "6.0") field(FLNK, "QUAD:AS01:122:STDZIFINAL") } record(ao, "QUAD:AS01:122:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(VAL, "-6.0") field(FLNK, "QUAD:AS01:122: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:AS01:122: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:AS01:122:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "QUAD:AS01:122:STDZIMIN CP NMS") field(INPB, "QUAD:AS01:122:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "QUAD:AS01:122:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "QUAD:AS01:122:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "QUAD:AS01:122:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "QUAD:AS01:122:STDZIMIN CP NMS") field(INPB, "QUAD:AS01:122:STDZIMAX CP NMS") field(INPC, "QUAD:AS01:122:TRIMRAMPRATE CP NMS") field(INPD, "1.0") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "QUAD:AS01:122:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "QUAD:AS01:122:TRIMDLYPCT CP MS") field(INPB, "QUAD:AS01:122: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:AS01:122: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:AS01:122: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:AS01:122:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "QUAD:AS01:122:IDES.HOPR") field(INPB, "QUAD:AS01:122:STDZMINIPCT CPP NMS") field(INPC, "QUAD:AS01:122:IDES.LOPR") field(PREC, "5") } record(calc, "QUAD:AS01:122:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "QUAD:AS01:122:IDES.HOPR") field(INPB, "QUAD:AS01:122:IDES.LOPR") field(INPC, "QUAD:AS01:122:STDZDIRECT.RVAL") field(INPD, "QUAD:AS01:122:STDZMINIDELTA") field(INPE, "QUAD:AS01:122:IDES") field(PREC, "5") field(FLNK, "QUAD:AS01:122: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:AS01:122:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "QUAD:AS01:122:IDES.HOPR") field(INPB, "QUAD:AS01:122:IDES.LOPR") field(INPC, "QUAD:AS01:122:STDZDIRECT.RVAL") field(INPD, "QUAD:AS01:122:STDZMINIDELTA") field(INPE, "QUAD:AS01:122: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:AS01:122: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:AS01:122:IADJUST.RVAL") field(INPB, "QUAD:AS01:122:STDZDIRECT.RVAL") field(INPC, "QUAD:AS01:122:STDZOK.RVAL") field(INPD, "QUAD:AS01:122:STDZDISABLE.RVAL") field(INPE, "QUAD:AS01:122:STATE.RVAL CPP NMS") field(INPF, "QUAD:AS01:122:ICTRL.RVAL") field(INPG, "QUAD:AS01:122:STATE.SEVR") field(INPH, "QUAD:AS01:122:BDELTAS.M") field(INPI, "QUAD:AS01:122:IACT.SEVR") field(OUT, "QUAD:AS01:122:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "QUAD:AS01:122:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "QUAD:AS01:122:STDZLOSTTOD.PROC") field(LNK2, "QUAD:AS01:122:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "QUAD:AS01:122:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "QUAD:AS01:122:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:AS01:122:IACT CP") field(INPB, "QUAD:AS01:122:STDZIACTMAX") field(EGU, "A") field(FLNK, "QUAD:AS01:122: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:AS01:122:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "QUAD:AS01:122:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:AS01:122:STDZIACTMAX") field(INPB, "QUAD:AS01:122:IACT") field(INPC, "QUAD:AS01:122:IDELTAS.I") field(OUT, "QUAD:AS01:122: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:AS01:122:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "QUAD:AS01:122:STDZOK.RVAL CP") field(INPB, "QUAD:AS01:122:STDZDISABLE.RVAL CP") field(INPC, "QUAD:AS01:122: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:AS01:122: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:AS01:122:CALBOK") { field(DESC, "Successful Calibration") field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "") 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:AS01:122:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "QUAD:AS01:122:CALBOK") field(INPB, "QUAD:AS01:122:CALBDISABLE") field(INPC, "QUAD:AS01:122:CALBSLOPE") field(OOPT, "On Change") field(OUT, "QUAD:AS01:122: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:AS01:122:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "QUAD:AS01:122: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:AS01:122:CALBSLOPE") field(DOL3, "QUAD:AS01:122:CALBOFFSET") field(DOL4, "0") field(DOL5, "0") field(LNK1, "MCOR:AS01:103:VSETPT.DISA PP NMS") field(LNK2, "MCOR:AS01:103:VSETPT.ASLO PP NMS") field(LNK3, "MCOR:AS01:103:VSETPT.AOFF PP NMS") field(LNK4, "MCOR:AS01:103:VSETPT.LINR PP NMS") field(LNK5, "MCOR:AS01:103:VSETPT.DISA PP NMS") # # 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, "MCOR:AS01:103:VSETPT.DISA PP NMS") field(LNK7, "MCOR:AS01:103:VSETPT.ASLO PP NMS") field(LNK8, "MCOR:AS01:103:VSETPT.AOFF PP NMS") field(LNK9, "MCOR:AS01:103:VSETPT.LINR PP NMS") field(LNKA, "MCOR:AS01:103:VSETPT.DISA PP NMS") } record(stringout, "QUAD:AS01:122:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "QUAD:AS01:122: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:AS01:122: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:AS01:122: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:AS01:122:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "QUAD:AS01:122: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:AS01:122:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "MCOR:AS01:103:VSETPT.ESLO") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:AS01:122:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "QUAD:AS01:122:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "MCOR:AS01:103:VSETPT.EOFF") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:AS01:122: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:AS01:122:CALCDAC") { field(DESC, "IACT to DAC Counts") field(CALC, "D=0?0:(((C*A)+B)-E)/D") field(INPA, "MCOR:AS01:103:I2VSLOPE") field(INPB, "0.0") field(INPC, "QUAD:AS01:122:IACT") field(INPD, "QUAD:AS01:122:DACSLOPE") field(INPE, "QUAD:AS01:122:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "QUAD:AS01:122:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "MCOR:AS01:103:VSETPT.RVAL CP") field(OMSL, "closed_loop") field(PREC, "6") field(PINI, "YES") } record(ao, "QUAD:AS01:122:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "6.0") field(HOPR, "6.0") field(DRVL, "-6.0") field(LOPR, "-6.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "QUAD:AS01:122:CALBIMAX") } record(ao, "QUAD:AS01:122:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "6.0") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVL, "-6.0") field(EGU, "A") field(VAL, "6.0") field(FLNK, "QUAD:AS01:122:CALBSTEPNUM") } record(ao, "QUAD:AS01:122:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(VAL, "0") } record(longout, "QUAD:AS01:122: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:AS01:122:CALBIDELTA") } record(calc, "QUAD:AS01:122:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "QUAD:AS01:122:CALBIMAX") field(INPB, "QUAD:AS01:122:CALBIMIN") field(INPC, "QUAD:AS01:122: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:AS01:122:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "MCOR:AS01:103:ISETPT.DRVH") field(INPB, "MCOR:AS01:103:IACT.HOPR") field(INPC, "QUAD:AS01:122:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "QUAD:AS01:122:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "QUAD:AS01:122:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:AS01:122:DACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:AS01:122:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:AS01:122: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:AS01:122:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:AS01:122:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:AS01:122:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:AS01:122: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:AS01:122:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:AS01:122:CALBYSA") } # Used only for xygraph edm plot record(subArray, "QUAD:AS01:122:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:AS01:122:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "QUAD:AS01:122:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:AS01:122:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "QUAD:AS01:122:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "QUAD:AS01:122:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "QUAD:AS01:122:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "QUAD:AS01:122: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:AS01:122:CALBSTEPNUM") field(INPB, "QUAD:AS01:122:CALBIACTWF") field(INPC, "QUAD:AS01:122: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:AS01:122: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:AS01:122:STDZITOL") field(INPH, "QUAD:AS01:122:DACSLOPE") field(INPI, "QUAD:AS01:122: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:AS01:122: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:AS01:122:CALBSTEPNUM") field(INPB, "QUAD:AS01:122:CALBIACTWF") field(INPC, "QUAD:AS01:122:DACWF") field(INPF, "QUAD:AS01:122: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:AS01:122CALBOK 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:AS01:122:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "QUAD:AS01:122:DEGAUSIMIN.PROC PP") field(OUTB, "QUAD:AS01:122:DEGAUSIMAX.PROC PP") field(OUTC, "QUAD:AS01:122:DEGAUSTYPE.PROC PP") field(OUTD, "QUAD:AS01:122:DEGAUSSTEP.PROC PP") field(OUTE, "QUAD:AS01:122:MADNAME.PROC PP") field(OUTF, "QUAD:AS01:122:PSTYPE.PROC PP") field(OUTG, "QUAD:AS01:122: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:AS01:122:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "QUAD:AS01:122:DEGAUSIMIN NPP NMS") field(INPB, "QUAD:AS01:122:DEGAUSIMAX NPP NMS") field(INPC, "QUAD:AS01:122:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "QUAD:AS01:122:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "QUAD:AS01:122:PSTYPE NPP NMS") field(INPG, "QUAD:AS01:122:DEBUG.RVAL NPP NMS") field(INPH, "QUAD:AS01:122: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:AS01:122:DEGAUSWF PP") field(OUTB, "QUAD:AS01:122:DEGAUSMSG PP") field(OUTC, "QUAD:AS01:122: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:AS01:122:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"QUAD:AS01:122: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:AS01:122: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:AS01:122: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:AS01:122: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:AS01:122: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:AS01:122:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(VAL, "-6.0") } record(ao, "QUAD:AS01:122:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(VAL, "6.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:AS01:122: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:AS01:122: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:AS01:122: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:AS01:122: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:AS01:122: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:AS01:122: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:AS01:122:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:AS01:122:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:AS01:122:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:AS01:122:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:AS01:122: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:AS01:122: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:AS01:122: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:AS01:122:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "QUAD:AS01:122:DEGAUS_IMAX") field(INPB, "QUAD:AS01:122:ISETPT") field(INPC, "QUAD:AS01:122:DEGAUSTYPE.RVAL") field(OUT, "QUAD:AS01:122:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "QUAD:AS01:122:DEGAUS_IMAX_UPDATE") } record(seq, "QUAD:AS01:122:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "QUAD:AS01:122:ISETPT") field(LNK1, "QUAD:AS01:122:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "QUAD:AS01:122:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(VAL, "6.0") field(FLNK, "QUAD:AS01:122:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "QUAD:AS01:122:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "QUAD:AS01:122:DEGAUS_IMAX") field(FLNK, "QUAD:AS01:122:DEGAUS_IMAXPOL") } record(bo, "QUAD:AS01:122:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:AS01:122:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "QUAD:AS01:122: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:AS01:122:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "QUAD:AS01:122:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "6.0") field(LOPR, "-6.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "QUAD:AS01:122: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:AS01:122:IACT") field(INPB, "QUAD:AS01:122:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "QUAD:AS01:122:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "QUAD:AS01:122:IACTPOL") } record(bo, "QUAD:AS01:122: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:AS01:122: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:AS01:122:DEGAUSENABLE CP") field(INPB, "QUAD:AS01:122:DEGAUSOK") field(INPC, "QUAD:AS01:122:STATE CP") field(INPD, "QUAD:AS01:122:STATE.SEVR") field(OUT, "QUAD:AS01:122:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "QUAD:AS01:122:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "QUAD:AS01:122:DEGAUS_STATE_CHECK") field(LNK1, "QUAD:AS01:122:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "QUAD:AS01:122:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "QUAD:AS01:122:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "QUAD:AS01:122: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:AS01:122:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "QUAD:AS01:122:DEGAUSOK.ZSV") field(LNK2, "QUAD:AS01:122: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:AS01:122:STATMSG.FRSV") field(LNK4, "QUAD:AS01:122: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:AS01:122:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "QUAD:AS01:122:DEGAUSOK.ZSV") field(LNK2, "QUAD:AS01:122: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:AS01:122:STATMSG.FRSV") field(LNK4, "QUAD:AS01:122: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:AS01:122:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "QUAD:AS01:122: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:AS01:122:STATMSG.FRSV") field(LNK3, "QUAD:AS01:122: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:AS01:122:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "QUAD:AS01:122: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:AS01:122:STATMSG.FRSV PP") field(LNK3, "QUAD:AS01:122:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "QUAD:AS01:122:FUNC") { field(DESC, "QUAD:AS01:122 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, "0") field(NIVL, "0") field(TEVL, "0") field(ELVL, "5") field(TVVL, "6") field(TTVL, "7") field(FTVL, "4") field(FFVL, "3") field(OUT, "QUAD:AS01:122:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "QUAD:AS01:122:CTRL") { field(DESC, "QUAD:AS01:122 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, "") field(TVST, "") field(TTST, "") 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, "0") field(TVVL, "0") field(TTVL, "0") field(FTVL, "0") field(FFVL, "0") field(OUT, "QUAD:AS01:122:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "QUAD:AS01:122:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "QUAD:AS01:122:BUSY") } # Set to FREE on IOC reboot record(bo, "QUAD:AS01:122:BUSY") { field(DESC, "QUAD:AS01:122 Ctrl Done") field(DOL, "QUAD:AS01:122:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "QUAD:AS01:122:SELECT") } record(bo, "QUAD:AS01:122:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "QUAD:AS01:122: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:AS01:122:CTRLSTATE") { field(DESC, "QUAD:AS01:122 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:AS01:122:CTRL",20,20,0,0,"QUAD:AS01:122:CTRL") #! Field("QUAD:AS01:122:CTRL.OUT",16777215,1,"QUAD:AS01:122:CTRL.OUT") #! Link("QUAD:AS01:122:CTRL.OUT","QUAD:AS01:122:SELECTEN.A") #! Field("QUAD:AS01:122:CTRL.VAL",16777215,1,"QUAD:AS01:122:CTRL.VAL") #! Record("QUAD:AS01:122:SELECTEN",321,381,0,0,"QUAD:AS01:122:SELECTEN") #! Field("QUAD:AS01:122:SELECTEN.A",16777215,0,"QUAD:AS01:122:SELECTEN.A") #! Field("QUAD:AS01:122:SELECTEN.FLNK",16777215,1,"QUAD:AS01:122:SELECTEN.FLNK") #! Link("QUAD:AS01:122:SELECTEN.FLNK","QUAD:AS01:122:BUSY") #! Field("QUAD:AS01:122:SELECTEN.VAL",16777215,1,"QUAD:AS01:122:SELECTEN.VAL") #! Record("QUAD:AS01:122:BUSY",623,274,0,0,"QUAD:AS01:122:BUSY") #! Field("QUAD:AS01:122:BUSY.DOL",16777215,0,"QUAD:AS01:122:BUSY.DOL") #! Link("QUAD:AS01:122:BUSY.DOL","QUAD:AS01:122:SELECTEN.VAL") #! Field("QUAD:AS01:122:BUSY.FLNK",16777215,1,"QUAD:AS01:122:BUSY.FLNK") #! Link("QUAD:AS01:122:BUSY.FLNK","QUAD:AS01:122:SELECT") #! Record("QUAD:AS01:122:SELECT",669,508,0,1,"QUAD:AS01:122:SELECT") #! Record("QUAD:AS01:122:FUNC",940,120,0,0,"QUAD:AS01:122:FUNC") #! Field("QUAD:AS01:122:FUNC.OUT",16777215,0,"QUAD:AS01:122:FUNC.OUT") #! Link("QUAD:AS01:122:FUNC.OUT","QUAD:AS01:122:CTRL.VAL") #! Record("QUAD:AS01:122:ABORT",193,41,0,0,"QUAD:AS01:122:ABORT") #! Record("QUAD:AS01:122:CTRLSTATE",369,34,0,0,"QUAD:AS01:122: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:AS01:122:SELECT is used for Multi-device selection.\nIt is enabled when associated QUAD:AS01:122:CTRL is \"0\" (DONE).\nIt is disabled when associated QUAD:AS01:122: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:AS01:122: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:AS01:122:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "QUAD:AS01:122:BCTRL.SEVR") field(OUT, "QUAD:AS01:122: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:AS01:122:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:AS01:122:BACT") field(INPB, "QUAD:AS01:122:POLYCOEF") field(INPC, "QUAD:AS01:122:POLYCOEF.A") field(INPD, "QUAD:AS01:122:POLYCOEF.B") field(INPE, "QUAD:AS01:122:IACT MS") field(INPF, "QUAD:AS01:122:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "13.2") field(LOPR, "-13.2") field(HIHI, "13.2") field(LOLO, "-13.2") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "13.2") field(LOW, "-13.2") field(FLNK, "QUAD:AS01:122: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:AS01:122: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:AS01:122:BDES") field(INPB, "QUAD:AS01:122:TRIMBTOL") field(INPC, "QUAD:AS01:122:TRIMBTOLR") field(INPD, "QUAD:AS01:122:CHCKBTOL") field(INPE, "QUAD:AS01:122:CHCKBTOLR") field(F, "0.0") field(INPG, "30") field(INPH, "QUAD:AS01:122:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "QUAD:AS01:122:MPSBTOL") field(INPQ, "QUAD:AS01:122:MPSBTOLR") field(FLNK, "QUAD:AS01:122:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "QUAD:AS01:122:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "QUAD:AS01:122:BDES") field(INPB, "QUAD:AS01:122:BDELTAS.I") field(INPG, "QUAD:AS01:122:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "QUAD:AS01:122:BCON.HIGH") field(OUTB, "QUAD:AS01:122:BCON.LOW") field(OUTC, "QUAD:AS01:122:BCON.HIHI") field(OUTD, "QUAD:AS01:122:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "QUAD:AS01:122:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "QUAD:AS01:122:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "QUAD:AS01:122:BDIFF") field(LNK2, "QUAD:AS01:122:BADIFF") field(LNK3, "QUAD:AS01:122:BRATIO") field(LNK4, "QUAD:AS01:122:MPSLIMITS") field(LNK5, "QUAD:AS01:122:I2BSTATUS") field(LNK6, "QUAD:AS01:122:IACTFO.PROC") } record(calc, "QUAD:AS01:122:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "QUAD:AS01:122:BDES") field(INPB, "QUAD:AS01:122:BACT") field(EGU, "kG") field(PREC, "7") } record(calc, "QUAD:AS01:122:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "QUAD:AS01:122:BDIFF") field(EGU, "kG") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "QUAD:AS01:122:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "QUAD:AS01:122:BDIFF") field(INPB, "QUAD:AS01:122:BDES.HOPR") field(EGU, "kG") field(PREC, "7") } record(mbbi, "QUAD:AS01:122: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:AS01:122:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "QUAD:AS01:122:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:AS01:122:BMON") field(INPB, "QUAD:AS01:122:POLYCOEF") field(INPC, "QUAD:AS01:122:POLYCOEF.A") field(INPD, "QUAD:AS01:122:POLYCOEF.B") field(INPE, "QUAD:AS01:122:IMON MS") field(INPF, "QUAD:AS01:122:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG") field(HOPR, "13.2") field(LOPR, "-13.2") field(HIHI, "13.2") field(LOLO, "-13.2") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "13.2") field(LOW, "-13.2") } # 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=MCOR:AS01:103:BDES CP record(ao, "QUAD:AS01:122:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "13.2") field(DRVL, "-13.2") field(HOPR, "13.2") field(LOPR, "-13.2") field(PREC, "7") field(EGU, "kG") field(MDEL, "-1") field(OMSL, "supervisory") # field(DOL, "") field(OUT, "QUAD:AS01:122:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "QUAD:AS01:122:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:AS01:122:POLYCOEF") field(INPC, "QUAD:AS01:122:POLYCOEF.A") field(INPD, "QUAD:AS01:122:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "13.2") field(LOPR, "-13.2") field(MDEL, "-1") field(INPE, "QUAD:AS01:122:BDES.DRVH") field(INPF, "QUAD:AS01:122:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:AS01:122:IDES") } record(sub, "QUAD:AS01:122:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:AS01:122:POLYCOEF") field(INPC, "QUAD:AS01:122:POLYCOEF.A") field(INPD, "QUAD:AS01:122:POLYCOEF.B") field(INPE, "QUAD:AS01:122:BDES.DRVH") field(INPF, "QUAD:AS01:122:BDES.DRVL") field(EGU, "kG") field(HOPR, "13.2") field(LOPR, "-13.2") field(PREC, "7") field(VAL, "0.0") field(FLNK, "QUAD:AS01:122:INOM") } record(sub, "QUAD:AS01:122:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:AS01:122:BDES.VAL") field(INPB, "QUAD:AS01:122:BDES.DRVH") field(INPC, "QUAD:AS01:122:BDES.DRVL") field(INPD, "QUAD:AS01:122:BDELTAS.I") field(INPE, "QUAD:AS01:122:BDELTAS.J") field(INPG, "QUAD:AS01:122:STATE") field(INPH, "QUAD:AS01:122:HSTA") field(EGU, "kG") field(HOPR, "13.2") field(LOPR, "-13.2") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "QUAD:AS01:122:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:AS01:122:BDES.VAL") field(INPB, "QUAD:AS01:122:BDES.DRVH") field(INPC, "QUAD:AS01:122:BDES.DRVL") field(INPD, "QUAD:AS01:122:BDELTAS.K") field(INPE, "QUAD:AS01:122:BDELTAS.L") field(INPG, "QUAD:AS01:122:STATE") field(INPH, "QUAD:AS01:122:HSTA") field(EGU, "kG") field(HOPR, "13.2") field(LOPR, "-13.2") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "QUAD:AS01:122:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "QUAD:AS01:122:BLIMITS") field(LNK1, "QUAD:AS01:122:BACTLIMITS.F PP") field(DOL2, "QUAD:AS01:122:BACTLIMITS.I") field(LNK2, "QUAD:AS01:122:BACT.HIGH") field(DOL3, "QUAD:AS01:122:BACTLIMITS.J") field(LNK3, "QUAD:AS01:122:BACT.LOW") field(DOL4, "QUAD:AS01:122:BACTLIMITS.K") field(LNK4, "QUAD:AS01:122:BACT.HIHI") field(DOL5, "QUAD:AS01:122:BACTLIMITS.L") field(LNK5, "QUAD:AS01:122:BACT.LOLO") field(DOL6, "QUAD:AS01:122:BLIMITS") field(LNK6, "QUAD:AS01:122:BMONLIMITS.F PP") field(DOL7, "QUAD:AS01:122:BMONLIMITS.I") field(LNK7, "QUAD:AS01:122:BMON.HIGH") field(DOL8, "QUAD:AS01:122:BMONLIMITS.J") field(LNK8, "QUAD:AS01:122:BMON.LOW") field(DOL9, "QUAD:AS01:122:BMONLIMITS.K") field(LNK9, "QUAD:AS01:122:BMON.HIHI") field(DOLA, "QUAD:AS01:122:BMONLIMITS.L") field(LNKA, "QUAD:AS01:122:BMON.LOLO") field(FLNK, "QUAD:AS01:122:ILIMITS") field(SCAN, "5 second") } record(ao, "QUAD:AS01:122:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG") field(DRVH, "13.2") field(DRVL, "-13.2") field(HOPR, "13.2") field(LOPR, "-13.2") # 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:AS01:122: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:AS01:122:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "QUAD:AS01:122:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "QUAD:AS01:122:BCTRL.VAL") field(LNK2, "QUAD:AS01:122:BDES PP") field(DOL3, "1") field(LNK3, "QUAD:AS01:122:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "QUAD:AS01:122:CHECKSTDZLOST.PROC PP") field(DOL5, "QUAD:AS01:122:BCTRL.VAL") field(LNK5, "QUAD:AS01:122:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "QUAD:AS01:122:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "QUAD:AS01:122:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:AS01:122:POLYCOEF") field(INPC, "QUAD:AS01:122:POLYCOEF.A") field(INPD, "QUAD:AS01:122:POLYCOEF.B") field(INPE, "QUAD:AS01:122:BDES.DRVH") field(INPF, "QUAD:AS01:122:BDES.DRVL") field(PREC, "7") field(EGU, "kG") field(HOPR, "13.2") field(LOPR, "-13.2") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "QUAD:AS01:122:ISETPT") } record(ao, "QUAD:AS01:122:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "13.2") field(DRVL, "-13.2") field(EGU, "kG") field(HOPR, "13.2") field(LOPR, "-13.2") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "QUAD:AS01:122:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "SQ01S") } record(ai, "QUAD:AS01:122: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, "2018.072") } record(ao, "QUAD:AS01:122:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "13.2") field(DRVL, "-13.2") field(EGU, "kG") field(HOPR, "13.2") field(LOPR, "-13.2") field(PREC, "7") field(PINI, "YES") field(VAL, "13.2") field(FLNK, "QUAD:AS01:122:BSTEP") } record(ao, "QUAD:AS01:122:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "13.2") field(DRVL, "-13.2") field(EGU, "kG") field(HOPR, "13.2") field(LOPR, "-13.2") field(PREC, "7") field(PINI, "YES") field(VAL, "-13.2") field(FLNK, "QUAD:AS01:122:BSTEP") } record(ao, "QUAD:AS01:122:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "13.2") field(DRVL, "-13.2") field(EGU, "kG") field(HOPR, "13.2") field(LOPR, "-13.2") field(PINI, "YES") field(PREC, "7") } # This record is processed by QUAD:AS01:122: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:AS01:122:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG") field(HOPR, "13.2") field(LOPR, "-13.2") field(DRVH, "13.2") field(DRVL, "-13.2") # 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:AS01:122:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "QUAD:AS01:122:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:AS01:122:POLYCOEF") field(INPC, "QUAD:AS01:122:POLYCOEF.A") field(INPD, "QUAD:AS01:122:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "13.2") field(LOPR, "-13.2") field(MDEL, "-1") field(INPE, "QUAD:AS01:122:BCON.DRVH") field(INPF, "QUAD:AS01:122:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:AS01:122: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:AS01:122:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "QUAD:AS01:122:BMAX") field(INPB, "QUAD:AS01:122:BMIN") field(INPC, "QUAD:AS01:122:BMIN.SEVR") field(INPD, "QUAD:AS01:122: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:AS01:122:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "QUAD:AS01:122:ONLINE CP") field(OUT, "QUAD:AS01:122:BCTRLDISABLEFOUT PP") } record(fanout, "QUAD:AS01:122:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "QUAD:AS01:122:BCTRLDISABLECALC") field(LNK1, "QUAD:AS01:122:BCTRLDISABLE") field(LNK2, "QUAD:AS01:122:BCTRLENABLE") } record(stringout, "QUAD:AS01:122:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:AS01:122:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "QUAD:AS01:122:BCTRLDISV_UPDATE") } record(stringout, "QUAD:AS01:122:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:AS01:122:BCTRL.ASG") field(VAL, "") field(FLNK, "QUAD:AS01:122:BCTRLDISV_UPDATE") } record(calcout, "QUAD:AS01:122:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "QUAD:AS01:122:ONLINE") field(OUT, "QUAD:AS01:122: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:AS01:122:BACT and MON\n are processed via links from \n QUAD:AS01:122:IACT (device raw value readback 1)\n and\n QUAD:AS01:122: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:AS01:122:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = QUAD:AS01:122: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:AS01:122:BDES\n is processed when set by CA users or \n QUAD:AS01:122: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:AS01:122: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:AS01:122: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:AS01:122: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:AS01:122:B*LIMITS and QUAD:AS01:122:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:AS01:122: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:AS01:122: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:AS01:122: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:AS01:122: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:AS01:122:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "QUAD:AS01:122:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "QUAD:AS01:122:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "13.2") field(DRVL, "-13.2") field(PINI, "YES") field(VAL, "13.2") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:AS01:122:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "13.2") field(DRVL, "-13.2") field(PINI, "YES") field(VAL, "-13.2") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:AS01:122:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "13.2") field(DRVL, "-13.2") field(PINI, "YES") field(VAL, "-13.2") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:AS01:122:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "13.2") field(DRVL, "-13.2") field(PINI, "YES") field(VAL, "-13.2") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "QUAD:AS01:122: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:AS01:122:MPSLIMITS.E PP") } record(aSub, "QUAD:AS01:122: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:AS01:122:MPS.RVAL") field(INPB, "QUAD:AS01:122:BADIFF") field(INPC, "QUAD:AS01:122:BDELTAS.N") field(INPD, "QUAD:AS01:122:BACT") field(INPE, "QUAD:AS01:122:MPSBITMASK.RVAL") field(INPF, "QUAD:AS01:122:MPSBLLIM") field(INPG, "QUAD:AS01:122:MPSBMIN") field(INPH, "QUAD:AS01:122:MPSBMAX") field(INPI, "QUAD:AS01:122: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:AS01:122:INTOL.RVAL PP") field(OUTB, "QUAD:AS01:122:INTOL_BMIN.RVAL PP") field(OUTC, "QUAD:AS01:122:INTOL_BRANGE.RVAL PP") field(OUTD, "QUAD:AS01:122: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:AS01:122:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:AS01:122:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:AS01:122:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:AS01:122:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:AS01:122:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:AS01:122:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:AS01:122:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:AS01:122: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:AS01:122:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "QUAD:AS01:122:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "QUAD:AS01:122:CHCKBTOL") field(INPB, "QUAD:AS01:122:POLYCOEF.B") field(PREC, "9") } record(calc, "QUAD:AS01:122: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:AS01:122:CHCKBTOL") field(FLNK, "QUAD:AS01:122:CHCKITOL") } record(calc, "QUAD:AS01:122:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "QUAD:AS01:122:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "QUAD:AS01:122:BDES.HOPR") field(INPB, "QUAD:AS01:122:STABILITY") field(INPC, "QUAD:AS01:122:BDES.LOPR") } record(longout, "QUAD:AS01:122:STABILITY") { field(DESC, "Long Term Stability") field(PINI, "YES") field(VAL, "1000") field(EGU, "ppm") field(DRVH, "3000") field(DRVL, "100") field(HOPR, "3000") field(LOPR, "100") field(FLNK, "QUAD:AS01:122:CHCKBTOL") } record(calc, "QUAD:AS01:122:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG") field(CALC, "ABS(A*B)") field(INPA, "QUAD:AS01:122:POLYCOEF.B") field(INPB, "QUAD:AS01:122:TRIMBTOL") field(PREC, "9") } record(ai, "QUAD:AS01:122: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:AS01:122: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:AS01:122:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "QUAD:AS01:122:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "QUAD:AS01:122:PAUGO") } record(fanout, "QUAD:AS01:122:PAUGO") { field(DESC, "PAU control") field(LNK1, "QUAD:AS01:122:PAUSTOP") field(LNK2, "QUAD:AS01:122: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:AS01:122:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "QUAD:AS01:122:PAU.RVAL") field(DISV, "0") field(DOL1, "0") field(DOL2, "0") field(DOL3, "1") field(DLY3, "1") # field(LNK1, "MCOR:AS01:103:ISETPT.DISV") # field(LNK2, "MCOR:AS01:103:VSETPT.DISV") # field(LNK3, "ACTPAU PP") } record(seq, "QUAD:AS01:122:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "QUAD:AS01:122:PAU.RVAL") field(DISV, "1") field(DOL1, "1") field(DOL2, "1") field(DOL3, "0") # field(LNK1, "MCOR:AS01:103:ISETPT.DISV") # field(LNK2, "MCOR:AS01:103:VSETPT.DISV") # field(LNK3, "ACTPAU PP") } # Change attribute to PSDEVNAME record(stringout, "QUAD:AS01:122:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "MCOR:AS01:103:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:AS01:122: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:AS01:122:PSTYPE.RVAL") field(INPC, "QUAD:AS01:122:TURNEDOFF.RVAL") field(INPD, "QUAD:AS01:122:CONFIG.RVAL") field(INPE, "QUAD:AS01:122:PSCATEGORY.RVAL") field(INPF, "QUAD:AS01:122:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:AS01:122:AUTOCTRL.RVAL") field(INPJ, "QUAD:AS01:122:OUTOFSERVICE.RVAL") field(INPL, "QUAD:AS01:122:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:AS01:122:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:AS01:122:PAU") field(INPP, "QUAD:AS01:122:CALBDISABLE.RVAL") field(INPQ, "QUAD:AS01:122:PTRBDISABLE.RVAL") field(INPR, "QUAD:AS01:122:TRIMDISABLE.RVAL") field(INPS, "QUAD:AS01:122:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:AS01:122:FBCK") field(INPU, "QUAD:AS01:122:TRIMTYPE.RVAL") field(INPV, "QUAD:AS01:122:STDZDIRECT.RVAL") field(INPW, "QUAD:AS01:122:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:AS01:122:HSTA") } record(longin, "QUAD:AS01:122:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:AS01:122:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:AS01:122: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:AS01:122: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:AS01:122: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:AS01:122: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:AS01:122: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:AS01:122: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:AS01:122:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:AS01:122:FBCK. # This PV should be replaced by QUAD:AS01:122: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:AS01:122: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:AS01:122: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:AS01:122: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:AS01:122:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:AS01:122:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:AS01:122:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:AS01:122:ONLINE PP") } record(bo, "QUAD:AS01:122:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:AS01:122: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:AS01:122: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:AS01:122: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:AS01:122: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:AS01:122: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:AS01:122: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:AS01:122: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:AS01:122: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, "QUAD:AS01:122: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, "0") field(ASG, "NOWRITE") } record(mbbo, "QUAD:AS01:122: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, "0") field(ASG, "NOWRITE") } record(mbbo, "QUAD:AS01:122: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:AS01:122:TRIMTYPE") } record(stringout, "QUAD:AS01:122:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:AS01:122:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:AS01:122:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:AS01:122:STATE.RVAL") field(INPB, "QUAD:AS01:122:INTLKSUMY.RVAL") field(OUT, "QUAD:AS01:122:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:AS01:122: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:AS01:122:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:AS01:122:STATE.RVAL") field(INPB, "QUAD:AS01:122:INTLKSUMY.RVAL") field(OUT, "QUAD:AS01:122:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:AS01:122:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:AS01:122:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:AS01:122: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:AS01:122: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:AS01:122: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:AS01:122: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:AS01:122: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:AS01:122:TURNEDOFF",3140,1907,0,1,"QUAD:AS01:122:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:AS01:122:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "QUAD:AS01:122:BACT.STAT") field(INPB, "QUAD:AS01:122:BDES.STAT") field(INPC, "QUAD:AS01:122:IRIPL.STAT") field(INPD, "MCOR:AS01:103:VSETPT.STAT") field(INPE, "MCOR:AS01:103:VACT.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:AS01:122:BACT.SEVR") field(INPH, "QUAD:AS01:122:BDES.SEVR") field(INPI, "QUAD:AS01:122:IRIPL.SEVR") field(INPJ, "MCOR:AS01:103:VSETPT.SEVR") field(INPK, "MCOR:AS01:103:VACT.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:AS01:122:STATE.RVAL") field(INPN, "QUAD:AS01:122:STDZOK") field(INPO, "QUAD:AS01:122:CALBOK") field(INPP, "QUAD:AS01:122:OUTOFSERVICE.RVAL") field(INPQ, "QUAD:AS01:122:CONFIG.RVAL") field(INPR, "QUAD:AS01:122:HSTA") field(INPS, "QUAD:AS01:122:CTRL.RVAL") field(INPT, "QUAD:AS01:122:DEGAUSOK") field(INPV, "QUAD:AS01:122: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:AS01:122:STAT") } record(longout, "QUAD:AS01:122:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "QUAD:AS01:122:STATCTRLSUB") field(DOL, "QUAD:AS01:122:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "QUAD:AS01:122:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "QUAD:AS01:122:STAT") field(INPB, "QUAD:AS01:122:HSTA") field(INPD, "QUAD:AS01:122:ONOFFCTRL.RVAL") field(FLNK, "QUAD:AS01:122:STATMSG") } record(mbbo, "QUAD:AS01:122: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:AS01:122:UNAVAILGO") field(DOL, "QUAD:AS01:122:STATCTRLSUB.W") } record(seq, "QUAD:AS01:122:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "QUAD:AS01:122:STATSUB.U") field(LNK1, "QUAD:AS01:122:UNAVAIL PP") } record(stringout, "QUAD:AS01:122:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"QUAD:AS01:122:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - QUAD:AS01:122:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - QUAD:AS01:122: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:AS01:122STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - QUAD:AS01:122:STATUS\nC - QUAD:AS01:122:ON\nD - QUAD:AS01:122:STDZOK\nE - QUAD:AS01:122:CALBOK\nF - QUAD:AS01:122:BACTDRIFT (future)\nG -\nH- QUAD:AS01:122:DACSTATUS\nI -QUAD:AS01:122:ADCSTATUS\nJ - QUAD:AS01:122:BACTSTATUS\nK - QUAD:AS01:122:BDESSTATUS\nL - QUAD:AS01:122:RIPLSTATUS\n\nOutput:\nP - QUAD:AS01:122: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:AS01:122: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:AS01:122: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:AS01:122: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:AS01:122: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 # Note: for slave with trim coils # set the macro ACT to the following: # ACT=:IACTCALC record(ai, "XCOR:AS01:121:IACT") { field(DESC, "Current") field(INP, "MCOR:AS01:105:IACT") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "XCOR:AS01:121:BACT") info(autosaveFields,"HYST") } record(bi, "XCOR:AS01:121:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "MCOR:AS01:105:STATE NPP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "XCOR:AS01:121:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "6.0") field(LOLO, "-6.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "XCOR:AS01:121:BDELTAS") field(DRVH, "6.0") field(DRVL, "-6.0") field(DOL, "XCOR:AS01:121: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, "XCOR:AS01:121:ICTRL PP") } # This record is processed by XCOR:AS01:121:ICON") # Note: we are not setting alarms here. record(ao, "XCOR:AS01:121:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(DOL, "XCOR:AS01:121:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "XCOR:AS01:121:INOM") { field(DESC, "Nominal Current") field(DOL, "XCOR:AS01:121:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "6.0") field(DRVL, "-6.0") field(HOPR, "6.0") field(LOPR, "-6.0") } record(ao, "XCOR:AS01:121:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(MDEL, "-1") field(FLNK, "XCOR:AS01:121:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "XCOR:AS01:121:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "XCOR:AS01:121:ISETPT.OMSL") field(DOL2, "XCOR:AS01:121:ICTRL") field(LNK2, "XCOR:AS01:121:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "XCOR:AS01:121:ISETPT.OMSL") } record(ao, "XCOR:AS01:121:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "6.0") field(DRVL, "-6.0") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(PINI, "YES") field(VAL, "6.0") field(FLNK, "XCOR:AS01:121:IMIN") } record(ao, "XCOR:AS01:121:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "6.0") field(DRVL, "-6.0") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(VAL, "-6.0") field(FLNK, "XCOR:AS01:121:IRANGE") } record(sel, "XCOR:AS01:121:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(NVL, "XCOR:AS01:121:BACT.SEVR") field(INPA, "XCOR:AS01:121:IACT NPP MS") field(INPB, "XCOR:AS01:121:IACTPREVOK NPP MS") field(INPC, "XCOR:AS01:121:IACTPREVOK NPP MS") field(INPD, "XCOR:AS01:121:IACTPREVOK NPP MS") } record(sub, "XCOR:AS01:121:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "XCOR:AS01:121:IDES") field(INPB, "XCOR:AS01:121:ISETPT.DRVH") field(INPC, "XCOR:AS01:121:ISETPT.DRVL") field(INPD, "XCOR:AS01:121:IDELTAS.I") field(INPE, "XCOR:AS01:121:IDELTAS.J") field(INPG, "XCOR:AS01:121:STATE") field(INPH, "XCOR:AS01:121:HSTA") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "XCOR:AS01:121:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "XCOR:AS01:121:IDES") field(INPB, "XCOR:AS01:121:ISETPT.DRVH") field(INPC, "XCOR:AS01:121:ISETPT.DRVL") field(INPD, "XCOR:AS01:121:IDELTAS.K") field(INPE, "XCOR:AS01:121:IDELTAS.L") field(INPG, "XCOR:AS01:121:STATE") field(INPH, "XCOR:AS01:121:HSTA") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "XCOR:AS01:121:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "XCOR:AS01:121:BLIMITS") field(LNK1, "XCOR:AS01:121:IACTLIMITS.F PP") field(DOL2, "XCOR:AS01:121:IACTLIMITS.I") field(LNK2, "XCOR:AS01:121:IACT.HIGH") field(DOL3, "XCOR:AS01:121:IACTLIMITS.J") field(LNK3, "XCOR:AS01:121:IACT.LOW") field(DOL4, "XCOR:AS01:121:IACTLIMITS.K") field(LNK4, "XCOR:AS01:121:IACT.HIHI") field(DOL5, "XCOR:AS01:121:IACTLIMITS.L") field(LNK5, "XCOR:AS01:121:IACT.LOLO") field(DOL6, "XCOR:AS01:121:BLIMITS") field(LNK6, "XCOR:AS01:121:IMONLIMITS.F PP") field(DOL7, "XCOR:AS01:121:IMONLIMITS.I") field(LNK7, "XCOR:AS01:121:IMON.HIGH") field(DOL8, "XCOR:AS01:121:IMONLIMITS.J") field(LNK8, "XCOR:AS01:121:IMON.LOW") field(DOL9, "XCOR:AS01:121:IMONLIMITS.K") field(LNK9, "XCOR:AS01:121:IMON.HIHI") field(DOLA, "XCOR:AS01:121:IMONLIMITS.L") field(LNKA, "XCOR:AS01:121: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, "XCOR:AS01:121:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "XCOR:AS01:121:TRIMBTOL") field(INPE, "XCOR:AS01:121:CHCKBTOL") field(INPF, "XCOR:AS01:121:BDELTAS.K") field(INPG, "XCOR:AS01:121:BDELTAS.L") field(INPH, "XCOR:AS01:121: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, "XCOR:AS01:121:STDZITOLR") field(INPC, "XCOR:AS01:121:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = MCOR:AS01:105: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, "XCOR:AS01:121: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 = MCOR:AS01:105:RESET PP # record(bo, "XCOR:AS01:121:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "MCOR:AS01:105:RESET PP") } record(bo, "XCOR:AS01:121:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "") 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, "XCOR:AS01:121: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, "XCOR:AS01:121:TRIMRAMPRATE") field(OUT, "") field(FLNK, "XCOR:AS01:121:STDZDLY") } record(ao, "XCOR:AS01:121:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(MDEL, "-1") field(OUT, "MCOR:AS01:105:ISETPT PP") field(DOL, "XCOR:AS01:121: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, "XCOR:AS01:121:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "XCOR:AS01:121:BMON") } record(ao, "XCOR:AS01:121:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "XCOR:AS01:121:IRIPLOK") } record(sub, "XCOR:AS01:121:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "XCOR:AS01:121:IRIPL.VAL") field(INPB, "XCOR:AS01:121: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, "XCOR:AS01:121: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, "XCOR:AS01:121:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") } record(bi, "XCOR:AS01:121:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "MCOR:AS01:105:INTLKSUMY NPP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "XCOR:AS01:121: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, "MCOR:AS01:105:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "XCOR:AS01:121:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "XCOR:AS01:121:IACTPREVOK") field(LNK2, "XCOR:AS01:121:IDIFF") field(LNK3, "XCOR:AS01:121:IADIFF") field(LNK4, "XCOR:AS01:121:IRATIO") field(LNK5, "XCOR:AS01:121:IDIRECT") field(LNK6, "XCOR:AS01:121:IACTPOL_CHECK") } record(calc, "XCOR:AS01:121:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "XCOR:AS01:121:IDES") field(INPB, "XCOR:AS01:121:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "6.0") field(LOPR, "-6.0") } record(calc, "XCOR:AS01:121:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "XCOR:AS01:121:IDIFF") field(PREC, "9") } record(calc, "XCOR:AS01:121:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "XCOR:AS01:121:IDIFF") field(INPB, "XCOR:AS01:121:IDES.DRVH") field(PREC, "9") } record(calcout, "XCOR:AS01:121:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "XCOR:AS01:121:IMIN") field(INPB, "XCOR:AS01:121: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, "XCOR:AS01:121: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, "XCOR:AS01:121:IACT") field(FLNK, "XCOR:AS01:121:IACTPOL") } record(bo, "XCOR:AS01:121:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "XCOR:AS01:121: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,"XCOR:AS01:121:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from XCOR:AS01:121:IDELTAS and the\n XCOR:AS01:121: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,"XCOR:AS01:121:IACT: \n Get copy of XCOR:AS01:121:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"XCOR:AS01:121: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,"XCOR:AS01:121:IDES:\n Contains raw value calculated by \nXCOR:AS01:121: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 \nXCOR:AS01:121:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"XCOR:AS01:121: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 XCOR:AS01:121: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 XCOR:AS01:121: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,"XCOR:AS01:121:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by XCOR:AS01:121:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, XCOR:AS01:121:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n XCOR:AS01:121: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, "XCOR:AS01:121:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "XCOR:AS01:121:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "XCOR:AS01:121:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "XCOR:AS01:121:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "XCOR:AS01:121:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "XCOR:AS01:121:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "0") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "XCOR:AS01:121: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, "XCOR:AS01:121:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "XCOR:AS01:121:TRIMTYPE.RVAL") field(INPB, "XCOR:AS01:121:CONFIG.RVAL") field(OUT, "XCOR:AS01:121:TRIMMAXNUM PP") } record(longout, "XCOR:AS01:121: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, "XCOR:AS01:121: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, "closed_loop") field(VAL, "1") field(OUT, "XCOR:AS01:121:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "XCOR:AS01:121: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, "closed_loop") field(VAL, "10") } record(bo, "XCOR:AS01:121: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, "XCOR:AS01:121: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, "XCOR:AS01:121:TRIMSTEPMIN") { field(DESC, "Min step in current") field(DTYP, "Soft Channel") field(DOL, "MCOR:AS01:105:ISTEP") field(PREC, "7") field(EGUF, "10") field(EGUL, "0") field(EGU, "A") field(HOPR, "10") field(LOPR, "0") field(VAL, "0.0001") } record(bo, "XCOR:AS01:121:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "1") } record(ao, "XCOR:AS01:121: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, "XCOR:AS01:121:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "XCOR:AS01:121: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, "XCOR:AS01:121: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, "XCOR:AS01:121:IMOVE") field(INPB, "XCOR:AS01:121:IACT") field(INPC, "XCOR:AS01:121:IRAMPRATE") field(INPD, "1.0") field(INPE, "XCOR:AS01:121:TRIMDLYPCT") field(INPF, "XCOR:AS01:121:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "XCOR:AS01:121:RAMPTIME_LEFT PP") } record(longout, "XCOR:AS01:121:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "XCOR:AS01:121:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "XCOR:AS01:121:RAMPDONE_CALC") } record(calc, "XCOR:AS01:121:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "XCOR:AS01:121:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "XCOR:AS01:121:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "XCOR:AS01:121: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, "XCOR:AS01:121:RAMPTIME_LEFT") field(OUT, "XCOR:AS01:121:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "XCOR:AS01:121:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "XCOR:AS01:121:RAMPTIME_LEFT NMS") field(OUT, "XCOR:AS01:121:RAMPDONE PP") } record(bo, "XCOR:AS01:121:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "XCOR:AS01:121:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "XCOR:AS01:121: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, "XCOR:AS01:121: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, "XCOR:AS01:121:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "XCOR:AS01:121:DEBUG.PROC PP") field(LNK2, "XCOR:AS01:121:STDZCYCLENUM.PROC PP") field(LNK3, "XCOR:AS01:121:STDZDISABLE.PROC PP") field(LNK4, "XCOR:AS01:121: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, "XCOR:AS01:121:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "XCOR:AS01:121:STDZIMIN NPP NMS") field(INPB, "XCOR:AS01:121:STDZIMAX NPP NMS") field(INPC, "XCOR:AS01:121:STDZIFINAL NPP NMS") field(INPD, "XCOR:AS01:121:STDZCYCLENUM NPP NMS") field(INPE, "XCOR:AS01:121:STDZDIRECT.RVAL NPP NMS") field(INPF, "XCOR:AS01:121:STDZDISABLE.RVAL CPP NMS") field(INPG, "XCOR:AS01:121: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, "XCOR:AS01:121:STDZWF PP") field(OUTB, "XCOR:AS01:121: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, "XCOR:AS01:121:STDZWF") } record(mbbo, "XCOR:AS01:121: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, "XCOR:AS01:121: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, "XCOR:AS01:121:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "XCOR:AS01:121: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, "XCOR:AS01:121: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, "XCOR:AS01:121: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, "XCOR:AS01:121:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "XCOR:AS01:121:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "XCOR:AS01:121:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "XCOR:AS01:121: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, "XCOR:AS01:121:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "XCOR:AS01:121:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "XCOR:AS01:121:STDZIMIN") } record(ao, "XCOR:AS01:121:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(VAL, "-6.0") field(FLNK, "XCOR:AS01:121:STDZIMAX") } record(ao, "XCOR:AS01:121:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(VAL, "6.0") field(FLNK, "XCOR:AS01:121:STDZIFINAL") } record(ao, "XCOR:AS01:121:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(VAL, "-6.0") field(FLNK, "XCOR:AS01:121: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, "XCOR:AS01:121: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, "XCOR:AS01:121:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "XCOR:AS01:121:STDZIMIN CP NMS") field(INPB, "XCOR:AS01:121:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "XCOR:AS01:121:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "XCOR:AS01:121:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "XCOR:AS01:121:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "XCOR:AS01:121:STDZIMIN CP NMS") field(INPB, "XCOR:AS01:121:STDZIMAX CP NMS") field(INPC, "XCOR:AS01:121:TRIMRAMPRATE CP NMS") field(INPD, "1.0") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "XCOR:AS01:121:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "XCOR:AS01:121:TRIMDLYPCT CP MS") field(INPB, "XCOR:AS01:121: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, "XCOR:AS01:121:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "XCOR:AS01:121: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, "XCOR:AS01:121:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "XCOR:AS01:121:IDES.HOPR") field(INPB, "XCOR:AS01:121:STDZMINIPCT CPP NMS") field(INPC, "XCOR:AS01:121:IDES.LOPR") field(PREC, "5") } record(calc, "XCOR:AS01:121:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "XCOR:AS01:121:IDES.HOPR") field(INPB, "XCOR:AS01:121:IDES.LOPR") field(INPC, "XCOR:AS01:121:STDZDIRECT.RVAL") field(INPD, "XCOR:AS01:121:STDZMINIDELTA") field(INPE, "XCOR:AS01:121:IDES") field(PREC, "5") field(FLNK, "XCOR:AS01:121: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, "XCOR:AS01:121:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "XCOR:AS01:121:IDES.HOPR") field(INPB, "XCOR:AS01:121:IDES.LOPR") field(INPC, "XCOR:AS01:121:STDZDIRECT.RVAL") field(INPD, "XCOR:AS01:121:STDZMINIDELTA") field(INPE, "XCOR:AS01:121: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, "XCOR:AS01:121: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, "XCOR:AS01:121:IADJUST.RVAL") field(INPB, "XCOR:AS01:121:STDZDIRECT.RVAL") field(INPC, "XCOR:AS01:121:STDZOK.RVAL") field(INPD, "XCOR:AS01:121:STDZDISABLE.RVAL") field(INPE, "XCOR:AS01:121:STATE.RVAL CPP NMS") field(INPF, "XCOR:AS01:121:ICTRL.RVAL") field(INPG, "XCOR:AS01:121:STATE.SEVR") field(INPH, "XCOR:AS01:121:BDELTAS.M") field(INPI, "XCOR:AS01:121:IACT.SEVR") field(OUT, "XCOR:AS01:121:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "XCOR:AS01:121:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "XCOR:AS01:121:STDZLOSTTOD.PROC") field(LNK2, "XCOR:AS01:121:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "XCOR:AS01:121:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "XCOR:AS01:121:CHECKPWRDIP_ENABLE") field(INPA, "XCOR:AS01:121:IACT CP") field(INPB, "XCOR:AS01:121:STDZIACTMAX") field(EGU, "A") field(FLNK, "XCOR:AS01:121: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, "XCOR:AS01:121:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "XCOR:AS01:121:CHECKPWRDIP_ENABLE") field(INPA, "XCOR:AS01:121:STDZIACTMAX") field(INPB, "XCOR:AS01:121:IACT") field(INPC, "XCOR:AS01:121:IDELTAS.I") field(OUT, "XCOR:AS01:121: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, "XCOR:AS01:121:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "XCOR:AS01:121:STDZOK.RVAL CP") field(INPB, "XCOR:AS01:121:STDZDISABLE.RVAL CP") field(INPC, "XCOR:AS01:121: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, "XCOR:AS01:121: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, "XCOR:AS01:121:CALBOK") { field(DESC, "Successful Calibration") field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "") 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, "XCOR:AS01:121:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "XCOR:AS01:121:CALBOK") field(INPB, "XCOR:AS01:121:CALBDISABLE") field(INPC, "XCOR:AS01:121:CALBSLOPE") field(OOPT, "On Change") field(OUT, "XCOR:AS01:121: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, "XCOR:AS01:121:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "XCOR:AS01:121: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, "XCOR:AS01:121:CALBSLOPE") field(DOL3, "XCOR:AS01:121:CALBOFFSET") field(DOL4, "0") field(DOL5, "0") field(LNK1, "MCOR:AS01:105:VSETPT.DISA PP NMS") field(LNK2, "MCOR:AS01:105:VSETPT.ASLO PP NMS") field(LNK3, "MCOR:AS01:105:VSETPT.AOFF PP NMS") field(LNK4, "MCOR:AS01:105:VSETPT.LINR PP NMS") field(LNK5, "MCOR:AS01:105:VSETPT.DISA PP NMS") # # 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, "MCOR:AS01:105:VSETPT.DISA PP NMS") field(LNK7, "MCOR:AS01:105:VSETPT.ASLO PP NMS") field(LNK8, "MCOR:AS01:105:VSETPT.AOFF PP NMS") field(LNK9, "MCOR:AS01:105:VSETPT.LINR PP NMS") field(LNKA, "MCOR:AS01:105:VSETPT.DISA PP NMS") } record(stringout, "XCOR:AS01:121:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "XCOR:AS01:121: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, "XCOR:AS01:121: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, "XCOR:AS01:121: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, "XCOR:AS01:121:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "XCOR:AS01:121: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, "XCOR:AS01:121:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "MCOR:AS01:105:VSETPT.ESLO") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "XCOR:AS01:121:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "XCOR:AS01:121:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "MCOR:AS01:105:VSETPT.EOFF") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "XCOR:AS01:121: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, "XCOR:AS01:121:CALCDAC") { field(DESC, "IACT to DAC Counts") field(CALC, "D=0?0:(((C*A)+B)-E)/D") field(INPA, "MCOR:AS01:105:I2VSLOPE") field(INPB, "0.0") field(INPC, "XCOR:AS01:121:IACT") field(INPD, "XCOR:AS01:121:DACSLOPE") field(INPE, "XCOR:AS01:121:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "XCOR:AS01:121:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "MCOR:AS01:105:VSETPT.RVAL CP") field(OMSL, "closed_loop") field(PREC, "6") field(PINI, "YES") } record(ao, "XCOR:AS01:121:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "6.0") field(HOPR, "6.0") field(DRVL, "-6.0") field(LOPR, "-6.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "XCOR:AS01:121:CALBIMAX") } record(ao, "XCOR:AS01:121:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "6.0") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVL, "-6.0") field(EGU, "A") field(VAL, "6.0") field(FLNK, "XCOR:AS01:121:CALBSTEPNUM") } record(ao, "XCOR:AS01:121:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(VAL, "0") } record(longout, "XCOR:AS01:121: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, "XCOR:AS01:121:CALBIDELTA") } record(calc, "XCOR:AS01:121:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "XCOR:AS01:121:CALBIMAX") field(INPB, "XCOR:AS01:121:CALBIMIN") field(INPC, "XCOR:AS01:121: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, "XCOR:AS01:121:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "MCOR:AS01:105:ISETPT.DRVH") field(INPB, "MCOR:AS01:105:IACT.HOPR") field(INPC, "XCOR:AS01:121:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "XCOR:AS01:121:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "XCOR:AS01:121:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "XCOR:AS01:121:DACSA") } # Used only for xygraph edm plot record(subArray, "XCOR:AS01:121:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "XCOR:AS01:121: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, "XCOR:AS01:121:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "XCOR:AS01:121:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "XCOR:AS01:121:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "XCOR:AS01:121: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, "XCOR:AS01:121:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "XCOR:AS01:121:CALBYSA") } # Used only for xygraph edm plot record(subArray, "XCOR:AS01:121:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "XCOR:AS01:121:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "XCOR:AS01:121:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "XCOR:AS01:121:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "XCOR:AS01:121:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "XCOR:AS01:121:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "XCOR:AS01:121:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "XCOR:AS01:121: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, "XCOR:AS01:121:CALBSTEPNUM") field(INPB, "XCOR:AS01:121:CALBIACTWF") field(INPC, "XCOR:AS01:121: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, "XCOR:AS01:121: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, "XCOR:AS01:121:STDZITOL") field(INPH, "XCOR:AS01:121:DACSLOPE") field(INPI, "XCOR:AS01:121: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, "XCOR:AS01:121: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, "XCOR:AS01:121:CALBSTEPNUM") field(INPB, "XCOR:AS01:121:CALBIACTWF") field(INPC, "XCOR:AS01:121:DACWF") field(INPF, "XCOR:AS01:121: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 XCOR:AS01:121CALBOK 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, "XCOR:AS01:121:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "XCOR:AS01:121:DEGAUSIMIN.PROC PP") field(OUTB, "XCOR:AS01:121:DEGAUSIMAX.PROC PP") field(OUTC, "XCOR:AS01:121:DEGAUSTYPE.PROC PP") field(OUTD, "XCOR:AS01:121:DEGAUSSTEP.PROC PP") field(OUTE, "XCOR:AS01:121:MADNAME.PROC PP") field(OUTF, "XCOR:AS01:121:PSTYPE.PROC PP") field(OUTG, "XCOR:AS01:121: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, "XCOR:AS01:121:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "XCOR:AS01:121:DEGAUSIMIN NPP NMS") field(INPB, "XCOR:AS01:121:DEGAUSIMAX NPP NMS") field(INPC, "XCOR:AS01:121:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "XCOR:AS01:121:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "XCOR:AS01:121:PSTYPE NPP NMS") field(INPG, "XCOR:AS01:121:DEBUG.RVAL NPP NMS") field(INPH, "XCOR:AS01:121: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, "XCOR:AS01:121:DEGAUSWF PP") field(OUTB, "XCOR:AS01:121:DEGAUSMSG PP") field(OUTC, "XCOR:AS01:121: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, "XCOR:AS01:121:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"XCOR:AS01:121: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, "XCOR:AS01:121: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, "XCOR:AS01:121: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, "XCOR:AS01:121: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, "XCOR:AS01:121: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, "XCOR:AS01:121:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(VAL, "-6.0") } record(ao, "XCOR:AS01:121:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(VAL, "6.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,"XCOR:AS01:121: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, "XCOR:AS01:121: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,"XCOR:AS01:121: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, "XCOR:AS01:121: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, "XCOR:AS01:121: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, "XCOR:AS01:121: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, "XCOR:AS01:121:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "XCOR:AS01:121:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "XCOR:AS01:121:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "XCOR:AS01:121:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "XCOR:AS01:121: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, "XCOR:AS01:121:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "XCOR:AS01:121: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, "XCOR:AS01:121:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "XCOR:AS01:121:DEGAUS_IMAX") field(INPB, "XCOR:AS01:121:ISETPT") field(INPC, "XCOR:AS01:121:DEGAUSTYPE.RVAL") field(OUT, "XCOR:AS01:121:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "XCOR:AS01:121:DEGAUS_IMAX_UPDATE") } record(seq, "XCOR:AS01:121:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "XCOR:AS01:121:ISETPT") field(LNK1, "XCOR:AS01:121:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "XCOR:AS01:121:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(VAL, "6.0") field(FLNK, "XCOR:AS01:121:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "XCOR:AS01:121:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "XCOR:AS01:121:DEGAUS_IMAX") field(FLNK, "XCOR:AS01:121:DEGAUS_IMAXPOL") } record(bo, "XCOR:AS01:121:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "XCOR:AS01:121:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "XCOR:AS01:121: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, "XCOR:AS01:121:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "XCOR:AS01:121:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "6.0") field(LOPR, "-6.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "XCOR:AS01:121:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "XCOR:AS01:121:IACT") field(INPB, "XCOR:AS01:121:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "XCOR:AS01:121:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "XCOR:AS01:121:IACTPOL") } record(bo, "XCOR:AS01:121: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,"XCOR:AS01:121: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, "XCOR:AS01:121:DEGAUSENABLE CP") field(INPB, "XCOR:AS01:121:DEGAUSOK") field(INPC, "XCOR:AS01:121:STATE CP") field(INPD, "XCOR:AS01:121:STATE.SEVR") field(OUT, "XCOR:AS01:121:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "XCOR:AS01:121:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "XCOR:AS01:121:DEGAUS_STATE_CHECK") field(LNK1, "XCOR:AS01:121:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "XCOR:AS01:121:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "XCOR:AS01:121:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "XCOR:AS01:121: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, "XCOR:AS01:121:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "XCOR:AS01:121:DEGAUSOK.ZSV") field(LNK2, "XCOR:AS01:121: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, "XCOR:AS01:121:STATMSG.FRSV") field(LNK4, "XCOR:AS01:121: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, "XCOR:AS01:121:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "XCOR:AS01:121:DEGAUSOK.ZSV") field(LNK2, "XCOR:AS01:121: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, "XCOR:AS01:121:STATMSG.FRSV") field(LNK4, "XCOR:AS01:121: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, "XCOR:AS01:121:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "XCOR:AS01:121: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, "XCOR:AS01:121:STATMSG.FRSV") field(LNK3, "XCOR:AS01:121: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, "XCOR:AS01:121:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "XCOR:AS01:121: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, "XCOR:AS01:121:STATMSG.FRSV PP") field(LNK3, "XCOR:AS01:121:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "XCOR:AS01:121:FUNC") { field(DESC, "XCOR:AS01:121 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, "0") field(NIVL, "0") field(TEVL, "0") field(ELVL, "5") field(TVVL, "6") field(TTVL, "7") field(FTVL, "4") field(FFVL, "3") field(OUT, "XCOR:AS01:121:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "XCOR:AS01:121:CTRL") { field(DESC, "XCOR:AS01:121 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, "") field(TVST, "") field(TTST, "") 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, "0") field(TVVL, "0") field(TTVL, "0") field(FTVL, "0") field(FFVL, "0") field(OUT, "XCOR:AS01:121:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "XCOR:AS01:121:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "XCOR:AS01:121:BUSY") } # Set to FREE on IOC reboot record(bo, "XCOR:AS01:121:BUSY") { field(DESC, "XCOR:AS01:121 Ctrl Done") field(DOL, "XCOR:AS01:121:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "XCOR:AS01:121:SELECT") } record(bo, "XCOR:AS01:121:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "XCOR:AS01:121: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, "XCOR:AS01:121:CTRLSTATE") { field(DESC, "XCOR:AS01:121 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("XCOR:AS01:121:CTRL",20,20,0,0,"XCOR:AS01:121:CTRL") #! Field("XCOR:AS01:121:CTRL.OUT",16777215,1,"XCOR:AS01:121:CTRL.OUT") #! Link("XCOR:AS01:121:CTRL.OUT","XCOR:AS01:121:SELECTEN.A") #! Field("XCOR:AS01:121:CTRL.VAL",16777215,1,"XCOR:AS01:121:CTRL.VAL") #! Record("XCOR:AS01:121:SELECTEN",321,381,0,0,"XCOR:AS01:121:SELECTEN") #! Field("XCOR:AS01:121:SELECTEN.A",16777215,0,"XCOR:AS01:121:SELECTEN.A") #! Field("XCOR:AS01:121:SELECTEN.FLNK",16777215,1,"XCOR:AS01:121:SELECTEN.FLNK") #! Link("XCOR:AS01:121:SELECTEN.FLNK","XCOR:AS01:121:BUSY") #! Field("XCOR:AS01:121:SELECTEN.VAL",16777215,1,"XCOR:AS01:121:SELECTEN.VAL") #! Record("XCOR:AS01:121:BUSY",623,274,0,0,"XCOR:AS01:121:BUSY") #! Field("XCOR:AS01:121:BUSY.DOL",16777215,0,"XCOR:AS01:121:BUSY.DOL") #! Link("XCOR:AS01:121:BUSY.DOL","XCOR:AS01:121:SELECTEN.VAL") #! Field("XCOR:AS01:121:BUSY.FLNK",16777215,1,"XCOR:AS01:121:BUSY.FLNK") #! Link("XCOR:AS01:121:BUSY.FLNK","XCOR:AS01:121:SELECT") #! Record("XCOR:AS01:121:SELECT",669,508,0,1,"XCOR:AS01:121:SELECT") #! Record("XCOR:AS01:121:FUNC",940,120,0,0,"XCOR:AS01:121:FUNC") #! Field("XCOR:AS01:121:FUNC.OUT",16777215,0,"XCOR:AS01:121:FUNC.OUT") #! Link("XCOR:AS01:121:FUNC.OUT","XCOR:AS01:121:CTRL.VAL") #! Record("XCOR:AS01:121:ABORT",193,41,0,0,"XCOR:AS01:121:ABORT") #! Record("XCOR:AS01:121:CTRLSTATE",369,34,0,0,"XCOR:AS01:121: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,"XCOR:AS01:121:SELECT is used for Multi-device selection.\nIt is enabled when associated XCOR:AS01:121:CTRL is \"0\" (DONE).\nIt is disabled when associated XCOR:AS01:121: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,"XCOR:AS01:121: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, "XCOR:AS01:121:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "XCOR:AS01:121:BCTRL.SEVR") field(OUT, "XCOR:AS01:121: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, "XCOR:AS01:121:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "XCOR:AS01:121:BACT") field(INPB, "XCOR:AS01:121:POLYCOEF") field(INPC, "XCOR:AS01:121:POLYCOEF.A") field(INPD, "XCOR:AS01:121:POLYCOEF.B") field(INPE, "XCOR:AS01:121:IACT MS") field(INPF, "XCOR:AS01:121:BDELTAS PP") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "521.0") field(LOPR, "-521.0") field(HIHI, "521.0") field(LOLO, "-521.0") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "521.0") field(LOW, "-521.0") field(FLNK, "XCOR:AS01:121: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, "XCOR:AS01:121: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, "XCOR:AS01:121:BDES") field(INPB, "XCOR:AS01:121:TRIMBTOL") field(INPC, "XCOR:AS01:121:TRIMBTOLR") field(INPD, "XCOR:AS01:121:CHCKBTOL") field(INPE, "XCOR:AS01:121:CHCKBTOLR") field(F, "0.0") field(INPG, "30") field(INPH, "XCOR:AS01:121:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "XCOR:AS01:121:MPSBTOL") field(INPQ, "XCOR:AS01:121:MPSBTOLR") field(FLNK, "XCOR:AS01:121:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "XCOR:AS01:121:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "XCOR:AS01:121:BDES") field(INPB, "XCOR:AS01:121:BDELTAS.I") field(INPG, "XCOR:AS01:121:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "XCOR:AS01:121:BCON.HIGH") field(OUTB, "XCOR:AS01:121:BCON.LOW") field(OUTC, "XCOR:AS01:121:BCON.HIHI") field(OUTD, "XCOR:AS01:121:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "XCOR:AS01:121:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "XCOR:AS01:121:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "XCOR:AS01:121:BDIFF") field(LNK2, "XCOR:AS01:121:BADIFF") field(LNK3, "XCOR:AS01:121:BRATIO") field(LNK4, "XCOR:AS01:121:MPSLIMITS") field(LNK5, "XCOR:AS01:121:I2BSTATUS") field(LNK6, "XCOR:AS01:121:IACTFO.PROC") } record(calc, "XCOR:AS01:121:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "XCOR:AS01:121:BDES") field(INPB, "XCOR:AS01:121:BACT") field(EGU, "kG-m") field(PREC, "7") } record(calc, "XCOR:AS01:121:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "XCOR:AS01:121:BDIFF") field(EGU, "kG-m") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "XCOR:AS01:121:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "XCOR:AS01:121:BDIFF") field(INPB, "XCOR:AS01:121:BDES.HOPR") field(EGU, "kG-m") field(PREC, "7") } record(mbbi, "XCOR:AS01:121: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, "XCOR:AS01:121:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "XCOR:AS01:121:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "XCOR:AS01:121:BMON") field(INPB, "XCOR:AS01:121:POLYCOEF") field(INPC, "XCOR:AS01:121:POLYCOEF.A") field(INPD, "XCOR:AS01:121:POLYCOEF.B") field(INPE, "XCOR:AS01:121:IMON MS") field(INPF, "XCOR:AS01:121:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "521.0") field(LOPR, "-521.0") field(HIHI, "521.0") field(LOLO, "-521.0") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "521.0") field(LOW, "-521.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=MCOR:AS01:105:BDES CP record(ao, "XCOR:AS01:121:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "521.0") field(DRVL, "-521.0") field(HOPR, "521.0") field(LOPR, "-521.0") field(PREC, "7") field(EGU, "kG-m") field(MDEL, "-1") field(OMSL, "supervisory") # field(DOL, "") field(OUT, "XCOR:AS01:121:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "XCOR:AS01:121:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "XCOR:AS01:121:POLYCOEF") field(INPC, "XCOR:AS01:121:POLYCOEF.A") field(INPD, "XCOR:AS01:121:POLYCOEF.B") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "521.0") field(LOPR, "-521.0") field(MDEL, "-1") field(INPE, "XCOR:AS01:121:BDES.DRVH") field(INPF, "XCOR:AS01:121:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "XCOR:AS01:121:IDES") } record(sub, "XCOR:AS01:121:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "XCOR:AS01:121:POLYCOEF") field(INPC, "XCOR:AS01:121:POLYCOEF.A") field(INPD, "XCOR:AS01:121:POLYCOEF.B") field(INPE, "XCOR:AS01:121:BDES.DRVH") field(INPF, "XCOR:AS01:121:BDES.DRVL") field(EGU, "kG-m") field(HOPR, "521.0") field(LOPR, "-521.0") field(PREC, "7") field(VAL, "0.0") field(FLNK, "XCOR:AS01:121:INOM") } record(sub, "XCOR:AS01:121:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "XCOR:AS01:121:BDES.VAL") field(INPB, "XCOR:AS01:121:BDES.DRVH") field(INPC, "XCOR:AS01:121:BDES.DRVL") field(INPD, "XCOR:AS01:121:BDELTAS.I") field(INPE, "XCOR:AS01:121:BDELTAS.J") field(INPG, "XCOR:AS01:121:STATE") field(INPH, "XCOR:AS01:121:HSTA") field(EGU, "kG-m") field(HOPR, "521.0") field(LOPR, "-521.0") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "XCOR:AS01:121:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "XCOR:AS01:121:BDES.VAL") field(INPB, "XCOR:AS01:121:BDES.DRVH") field(INPC, "XCOR:AS01:121:BDES.DRVL") field(INPD, "XCOR:AS01:121:BDELTAS.K") field(INPE, "XCOR:AS01:121:BDELTAS.L") field(INPG, "XCOR:AS01:121:STATE") field(INPH, "XCOR:AS01:121:HSTA") field(EGU, "kG-m") field(HOPR, "521.0") field(LOPR, "-521.0") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "XCOR:AS01:121:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "XCOR:AS01:121:BLIMITS") field(LNK1, "XCOR:AS01:121:BACTLIMITS.F PP") field(DOL2, "XCOR:AS01:121:BACTLIMITS.I") field(LNK2, "XCOR:AS01:121:BACT.HIGH") field(DOL3, "XCOR:AS01:121:BACTLIMITS.J") field(LNK3, "XCOR:AS01:121:BACT.LOW") field(DOL4, "XCOR:AS01:121:BACTLIMITS.K") field(LNK4, "XCOR:AS01:121:BACT.HIHI") field(DOL5, "XCOR:AS01:121:BACTLIMITS.L") field(LNK5, "XCOR:AS01:121:BACT.LOLO") field(DOL6, "XCOR:AS01:121:BLIMITS") field(LNK6, "XCOR:AS01:121:BMONLIMITS.F PP") field(DOL7, "XCOR:AS01:121:BMONLIMITS.I") field(LNK7, "XCOR:AS01:121:BMON.HIGH") field(DOL8, "XCOR:AS01:121:BMONLIMITS.J") field(LNK8, "XCOR:AS01:121:BMON.LOW") field(DOL9, "XCOR:AS01:121:BMONLIMITS.K") field(LNK9, "XCOR:AS01:121:BMON.HIHI") field(DOLA, "XCOR:AS01:121:BMONLIMITS.L") field(LNKA, "XCOR:AS01:121:BMON.LOLO") field(FLNK, "XCOR:AS01:121:ILIMITS") field(SCAN, "5 second") } record(ao, "XCOR:AS01:121:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG-m") field(DRVH, "521.0") field(DRVL, "-521.0") field(HOPR, "521.0") field(LOPR, "-521.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, "XCOR:AS01:121: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, "XCOR:AS01:121:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "XCOR:AS01:121:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "XCOR:AS01:121:BCTRL.VAL") field(LNK2, "XCOR:AS01:121:BDES PP") field(DOL3, "1") field(LNK3, "XCOR:AS01:121:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "XCOR:AS01:121:CHECKSTDZLOST.PROC PP") field(DOL5, "XCOR:AS01:121:BCTRL.VAL") field(LNK5, "XCOR:AS01:121:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "XCOR:AS01:121:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "XCOR:AS01:121:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "XCOR:AS01:121:POLYCOEF") field(INPC, "XCOR:AS01:121:POLYCOEF.A") field(INPD, "XCOR:AS01:121:POLYCOEF.B") field(INPE, "XCOR:AS01:121:BDES.DRVH") field(INPF, "XCOR:AS01:121:BDES.DRVL") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "521.0") field(LOPR, "-521.0") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "XCOR:AS01:121:ISETPT") } record(ao, "XCOR:AS01:121:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "521.0") field(DRVL, "-521.0") field(EGU, "kG-m") field(HOPR, "521.0") field(LOPR, "-521.0") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "XCOR:AS01:121:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "XC00S") } record(ai, "XCOR:AS01:121: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, "2018.072") } record(ao, "XCOR:AS01:121:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "521.0") field(DRVL, "-521.0") field(EGU, "kG-m") field(HOPR, "521.0") field(LOPR, "-521.0") field(PREC, "7") field(PINI, "YES") field(VAL, "521.0") field(FLNK, "XCOR:AS01:121:BSTEP") } record(ao, "XCOR:AS01:121:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "521.0") field(DRVL, "-521.0") field(EGU, "kG-m") field(HOPR, "521.0") field(LOPR, "-521.0") field(PREC, "7") field(PINI, "YES") field(VAL, "-521.0") field(FLNK, "XCOR:AS01:121:BSTEP") } record(ao, "XCOR:AS01:121:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "521.0") field(DRVL, "-521.0") field(EGU, "kG-m") field(HOPR, "521.0") field(LOPR, "-521.0") field(PINI, "YES") field(PREC, "7") } # This record is processed by XCOR:AS01:121: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, "XCOR:AS01:121:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "521.0") field(LOPR, "-521.0") field(DRVH, "521.0") field(DRVL, "-521.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, "XCOR:AS01:121:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "XCOR:AS01:121:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "XCOR:AS01:121:POLYCOEF") field(INPC, "XCOR:AS01:121:POLYCOEF.A") field(INPD, "XCOR:AS01:121:POLYCOEF.B") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "521.0") field(LOPR, "-521.0") field(MDEL, "-1") field(INPE, "XCOR:AS01:121:BCON.DRVH") field(INPF, "XCOR:AS01:121:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "XCOR:AS01:121: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, "XCOR:AS01:121:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "XCOR:AS01:121:BMAX") field(INPB, "XCOR:AS01:121:BMIN") field(INPC, "XCOR:AS01:121:BMIN.SEVR") field(INPD, "XCOR:AS01:121: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,"XCOR:AS01:121:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "XCOR:AS01:121:ONLINE CP") field(OUT, "XCOR:AS01:121:BCTRLDISABLEFOUT PP") } record(fanout, "XCOR:AS01:121:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "XCOR:AS01:121:BCTRLDISABLECALC") field(LNK1, "XCOR:AS01:121:BCTRLDISABLE") field(LNK2, "XCOR:AS01:121:BCTRLENABLE") } record(stringout, "XCOR:AS01:121:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "XCOR:AS01:121:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "XCOR:AS01:121:BCTRLDISV_UPDATE") } record(stringout, "XCOR:AS01:121:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "XCOR:AS01:121:BCTRL.ASG") field(VAL, "") field(FLNK, "XCOR:AS01:121:BCTRLDISV_UPDATE") } record(calcout, "XCOR:AS01:121:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "XCOR:AS01:121:ONLINE") field(OUT, "XCOR:AS01:121: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,"XCOR:AS01:121:BACT and MON\n are processed via links from \n XCOR:AS01:121:IACT (device raw value readback 1)\n and\n XCOR:AS01:121: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 XCOR:AS01:121:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = XCOR:AS01:121: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,"XCOR:AS01:121:BDES\n is processed when set by CA users or \n XCOR:AS01:121: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,"XCOR:AS01:121: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 XCOR:AS01:121: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 (XCOR:AS01:121: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,"XCOR:AS01:121:B*LIMITS and XCOR:AS01:121:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from XCOR:AS01:121: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,"XCOR:AS01:121: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,"XCOR:AS01:121: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, "XCOR:AS01:121: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, "XCOR:AS01:121:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG-m") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "XCOR:AS01:121:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "XCOR:AS01:121:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "521.0") field(DRVL, "-521.0") field(PINI, "YES") field(VAL, "521.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "XCOR:AS01:121:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "521.0") field(DRVL, "-521.0") field(PINI, "YES") field(VAL, "-521.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "XCOR:AS01:121:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "521.0") field(DRVL, "-521.0") field(PINI, "YES") field(VAL, "-521.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "XCOR:AS01:121:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "521.0") field(DRVL, "-521.0") field(PINI, "YES") field(VAL, "-521.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "XCOR:AS01:121: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, "XCOR:AS01:121:MPSLIMITS.E PP") } record(aSub, "XCOR:AS01:121: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, "XCOR:AS01:121:MPS.RVAL") field(INPB, "XCOR:AS01:121:BADIFF") field(INPC, "XCOR:AS01:121:BDELTAS.N") field(INPD, "XCOR:AS01:121:BACT") field(INPE, "XCOR:AS01:121:MPSBITMASK.RVAL") field(INPF, "XCOR:AS01:121:MPSBLLIM") field(INPG, "XCOR:AS01:121:MPSBMIN") field(INPH, "XCOR:AS01:121:MPSBMAX") field(INPI, "XCOR:AS01:121: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, "XCOR:AS01:121:INTOL.RVAL PP") field(OUTB, "XCOR:AS01:121:INTOL_BMIN.RVAL PP") field(OUTC, "XCOR:AS01:121:INTOL_BRANGE.RVAL PP") field(OUTD, "XCOR:AS01:121: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, "XCOR:AS01:121:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "XCOR:AS01:121:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "XCOR:AS01:121:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "XCOR:AS01:121:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "XCOR:AS01:121:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "XCOR:AS01:121:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "XCOR:AS01:121:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "XCOR:AS01:121: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, "XCOR:AS01:121:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "XCOR:AS01:121:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "XCOR:AS01:121:CHCKBTOL") field(INPB, "XCOR:AS01:121:POLYCOEF.B") field(PREC, "9") } record(calc, "XCOR:AS01:121: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, "XCOR:AS01:121:CHCKBTOL") field(FLNK, "XCOR:AS01:121:CHCKITOL") } record(calc, "XCOR:AS01:121:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "XCOR:AS01:121:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "XCOR:AS01:121:BDES.HOPR") field(INPB, "XCOR:AS01:121:STABILITY") field(INPC, "XCOR:AS01:121:BDES.LOPR") } record(longout, "XCOR:AS01:121:STABILITY") { field(DESC, "Long Term Stability") field(PINI, "YES") field(VAL, "1000") field(EGU, "ppm") field(DRVH, "3000") field(DRVL, "100") field(HOPR, "3000") field(LOPR, "100") field(FLNK, "XCOR:AS01:121:CHCKBTOL") } record(calc, "XCOR:AS01:121:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG-m") field(CALC, "ABS(A*B)") field(INPA, "XCOR:AS01:121:POLYCOEF.B") field(INPB, "XCOR:AS01:121:TRIMBTOL") field(PREC, "9") } record(ai, "XCOR:AS01:121:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "XCOR:AS01:121: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, "XCOR:AS01:121:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "XCOR:AS01:121:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "XCOR:AS01:121:PAUGO") } record(fanout, "XCOR:AS01:121:PAUGO") { field(DESC, "PAU control") field(LNK1, "XCOR:AS01:121:PAUSTOP") field(LNK2, "XCOR:AS01:121: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, "XCOR:AS01:121:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "XCOR:AS01:121:PAU.RVAL") field(DISV, "0") field(DOL1, "0") field(DOL2, "0") field(DOL3, "1") field(DLY3, "1") # field(LNK1, "MCOR:AS01:105:ISETPT.DISV") # field(LNK2, "MCOR:AS01:105:VSETPT.DISV") # field(LNK3, "ACTPAU PP") } record(seq, "XCOR:AS01:121:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "XCOR:AS01:121:PAU.RVAL") field(DISV, "1") field(DOL1, "1") field(DOL2, "1") field(DOL3, "0") # field(LNK1, "MCOR:AS01:105:ISETPT.DISV") # field(LNK2, "MCOR:AS01:105:VSETPT.DISV") # field(LNK3, "ACTPAU PP") } # Change attribute to PSDEVNAME record(stringout, "XCOR:AS01:121:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "MCOR:AS01:105:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "XCOR:AS01:121: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, "XCOR:AS01:121:PSTYPE.RVAL") field(INPC, "XCOR:AS01:121:TURNEDOFF.RVAL") field(INPD, "XCOR:AS01:121:CONFIG.RVAL") field(INPE, "XCOR:AS01:121:PSCATEGORY.RVAL") field(INPF, "XCOR:AS01:121:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "XCOR:AS01:121:AUTOCTRL.RVAL") field(INPJ, "XCOR:AS01:121:OUTOFSERVICE.RVAL") field(INPL, "XCOR:AS01:121:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "XCOR:AS01:121:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "XCOR:AS01:121:PAU") field(INPP, "XCOR:AS01:121:CALBDISABLE.RVAL") field(INPQ, "XCOR:AS01:121:PTRBDISABLE.RVAL") field(INPR, "XCOR:AS01:121:TRIMDISABLE.RVAL") field(INPS, "XCOR:AS01:121:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "XCOR:AS01:121:FBCK") field(INPU, "XCOR:AS01:121:TRIMTYPE.RVAL") field(INPV, "XCOR:AS01:121:STDZDIRECT.RVAL") field(INPW, "XCOR:AS01:121:DEGAUSENABLE.RVAL") field(FLNK, "XCOR:AS01:121:HSTA") } record(longin, "XCOR:AS01:121:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "XCOR:AS01:121:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "XCOR:AS01:121: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, "XCOR:AS01:121: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, "XCOR:AS01:121: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, "XCOR:AS01:121: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, "XCOR:AS01:121: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, "XCOR:AS01:121: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 XCOR:AS01:121:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses XCOR:AS01:121:FBCK. # This PV should be replaced by XCOR:AS01:121: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, "XCOR:AS01:121: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, "XCOR:AS01:121: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, "XCOR:AS01:121: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, "XCOR:AS01:121:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"XCOR:AS01:121:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "XCOR:AS01:121:OUTOFSERVICE NPP NMS") field(OUT, "XCOR:AS01:121:ONLINE PP") } record(bo, "XCOR:AS01:121:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "XCOR:AS01:121: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, "XCOR:AS01:121: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, "XCOR:AS01:121: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, "XCOR:AS01:121: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, "XCOR:AS01:121: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, "XCOR:AS01:121: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, "XCOR:AS01:121: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, "XCOR:AS01:121: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, "XCOR:AS01:121: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, "0") field(ASG, "NOWRITE") } record(mbbo, "XCOR:AS01:121: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, "0") field(ASG, "NOWRITE") } record(mbbo, "XCOR:AS01:121: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, "XCOR:AS01:121:TRIMTYPE") } record(stringout, "XCOR:AS01:121:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "XCOR:AS01:121:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "XCOR:AS01:121:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "XCOR:AS01:121:STATE.RVAL") field(INPB, "XCOR:AS01:121:INTLKSUMY.RVAL") field(OUT, "XCOR:AS01:121:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "XCOR:AS01:121: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, "XCOR:AS01:121:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "XCOR:AS01:121:STATE.RVAL") field(INPB, "XCOR:AS01:121:INTLKSUMY.RVAL") field(OUT, "XCOR:AS01:121:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "XCOR:AS01:121:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "XCOR:AS01:121:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "XCOR:AS01:121: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, "XCOR:AS01:121: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, "XCOR:AS01:121: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, "XCOR:AS01:121: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,"XCOR:AS01:121: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("XCOR:AS01:121:TURNEDOFF",3140,1907,0,1,"XCOR:AS01:121:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "XCOR:AS01:121:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "XCOR:AS01:121:BACT.STAT") field(INPB, "XCOR:AS01:121:BDES.STAT") field(INPC, "XCOR:AS01:121:IRIPL.STAT") field(INPD, "MCOR:AS01:105:VSETPT.STAT") field(INPE, "MCOR:AS01:105:VACT.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, "XCOR:AS01:121:BACT.SEVR") field(INPH, "XCOR:AS01:121:BDES.SEVR") field(INPI, "XCOR:AS01:121:IRIPL.SEVR") field(INPJ, "MCOR:AS01:105:VSETPT.SEVR") field(INPK, "MCOR:AS01:105:VACT.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, "XCOR:AS01:121:STATE.RVAL") field(INPN, "XCOR:AS01:121:STDZOK") field(INPO, "XCOR:AS01:121:CALBOK") field(INPP, "XCOR:AS01:121:OUTOFSERVICE.RVAL") field(INPQ, "XCOR:AS01:121:CONFIG.RVAL") field(INPR, "XCOR:AS01:121:HSTA") field(INPS, "XCOR:AS01:121:CTRL.RVAL") field(INPT, "XCOR:AS01:121:DEGAUSOK") field(INPV, "XCOR:AS01:121: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, "XCOR:AS01:121:STAT") } record(longout, "XCOR:AS01:121:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "XCOR:AS01:121:STATCTRLSUB") field(DOL, "XCOR:AS01:121:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "XCOR:AS01:121:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "XCOR:AS01:121:STAT") field(INPB, "XCOR:AS01:121:HSTA") field(INPD, "XCOR:AS01:121:ONOFFCTRL.RVAL") field(FLNK, "XCOR:AS01:121:STATMSG") } record(mbbo, "XCOR:AS01:121: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, "XCOR:AS01:121:UNAVAILGO") field(DOL, "XCOR:AS01:121:STATCTRLSUB.W") } record(seq, "XCOR:AS01:121:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "XCOR:AS01:121:STATSUB.U") field(LNK1, "XCOR:AS01:121:UNAVAIL PP") } record(stringout, "XCOR:AS01:121:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"XCOR:AS01:121:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - XCOR:AS01:121:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - XCOR:AS01:121: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,"XCOR:AS01:121STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - XCOR:AS01:121:STATUS\nC - XCOR:AS01:121:ON\nD - XCOR:AS01:121:STDZOK\nE - XCOR:AS01:121:CALBOK\nF - XCOR:AS01:121:BACTDRIFT (future)\nG -\nH- XCOR:AS01:121:DACSTATUS\nI -XCOR:AS01:121:ADCSTATUS\nJ - XCOR:AS01:121:BACTSTATUS\nK - XCOR:AS01:121:BDESSTATUS\nL - XCOR:AS01:121:RIPLSTATUS\n\nOutput:\nP - XCOR:AS01:121: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, "XCOR:AS01:121: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, "XCOR:AS01:121: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, "XCOR:AS01:121: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, "XCOR:AS01:121: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 # Note: for slave with trim coils # set the macro ACT to the following: # ACT=:IACTCALC record(ai, "YCOR:AS01:122:IACT") { field(DESC, "Current") field(INP, "MCOR:AS01:106:IACT") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "YCOR:AS01:122:BACT") info(autosaveFields,"HYST") } record(bi, "YCOR:AS01:122:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "MCOR:AS01:106:STATE NPP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "YCOR:AS01:122:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "6.0") field(LOLO, "-6.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "YCOR:AS01:122:BDELTAS") field(DRVH, "6.0") field(DRVL, "-6.0") field(DOL, "YCOR:AS01:122: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, "YCOR:AS01:122:ICTRL PP") } # This record is processed by YCOR:AS01:122:ICON") # Note: we are not setting alarms here. record(ao, "YCOR:AS01:122:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(DOL, "YCOR:AS01:122:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "YCOR:AS01:122:INOM") { field(DESC, "Nominal Current") field(DOL, "YCOR:AS01:122:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "6.0") field(DRVL, "-6.0") field(HOPR, "6.0") field(LOPR, "-6.0") } record(ao, "YCOR:AS01:122:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(MDEL, "-1") field(FLNK, "YCOR:AS01:122:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "YCOR:AS01:122:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "YCOR:AS01:122:ISETPT.OMSL") field(DOL2, "YCOR:AS01:122:ICTRL") field(LNK2, "YCOR:AS01:122:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "YCOR:AS01:122:ISETPT.OMSL") } record(ao, "YCOR:AS01:122:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "6.0") field(DRVL, "-6.0") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(PINI, "YES") field(VAL, "6.0") field(FLNK, "YCOR:AS01:122:IMIN") } record(ao, "YCOR:AS01:122:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "6.0") field(DRVL, "-6.0") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(VAL, "-6.0") field(FLNK, "YCOR:AS01:122:IRANGE") } record(sel, "YCOR:AS01:122:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(NVL, "YCOR:AS01:122:BACT.SEVR") field(INPA, "YCOR:AS01:122:IACT NPP MS") field(INPB, "YCOR:AS01:122:IACTPREVOK NPP MS") field(INPC, "YCOR:AS01:122:IACTPREVOK NPP MS") field(INPD, "YCOR:AS01:122:IACTPREVOK NPP MS") } record(sub, "YCOR:AS01:122:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "YCOR:AS01:122:IDES") field(INPB, "YCOR:AS01:122:ISETPT.DRVH") field(INPC, "YCOR:AS01:122:ISETPT.DRVL") field(INPD, "YCOR:AS01:122:IDELTAS.I") field(INPE, "YCOR:AS01:122:IDELTAS.J") field(INPG, "YCOR:AS01:122:STATE") field(INPH, "YCOR:AS01:122:HSTA") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "YCOR:AS01:122:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "YCOR:AS01:122:IDES") field(INPB, "YCOR:AS01:122:ISETPT.DRVH") field(INPC, "YCOR:AS01:122:ISETPT.DRVL") field(INPD, "YCOR:AS01:122:IDELTAS.K") field(INPE, "YCOR:AS01:122:IDELTAS.L") field(INPG, "YCOR:AS01:122:STATE") field(INPH, "YCOR:AS01:122:HSTA") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "YCOR:AS01:122:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "YCOR:AS01:122:BLIMITS") field(LNK1, "YCOR:AS01:122:IACTLIMITS.F PP") field(DOL2, "YCOR:AS01:122:IACTLIMITS.I") field(LNK2, "YCOR:AS01:122:IACT.HIGH") field(DOL3, "YCOR:AS01:122:IACTLIMITS.J") field(LNK3, "YCOR:AS01:122:IACT.LOW") field(DOL4, "YCOR:AS01:122:IACTLIMITS.K") field(LNK4, "YCOR:AS01:122:IACT.HIHI") field(DOL5, "YCOR:AS01:122:IACTLIMITS.L") field(LNK5, "YCOR:AS01:122:IACT.LOLO") field(DOL6, "YCOR:AS01:122:BLIMITS") field(LNK6, "YCOR:AS01:122:IMONLIMITS.F PP") field(DOL7, "YCOR:AS01:122:IMONLIMITS.I") field(LNK7, "YCOR:AS01:122:IMON.HIGH") field(DOL8, "YCOR:AS01:122:IMONLIMITS.J") field(LNK8, "YCOR:AS01:122:IMON.LOW") field(DOL9, "YCOR:AS01:122:IMONLIMITS.K") field(LNK9, "YCOR:AS01:122:IMON.HIHI") field(DOLA, "YCOR:AS01:122:IMONLIMITS.L") field(LNKA, "YCOR:AS01:122: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, "YCOR:AS01:122:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "YCOR:AS01:122:TRIMBTOL") field(INPE, "YCOR:AS01:122:CHCKBTOL") field(INPF, "YCOR:AS01:122:BDELTAS.K") field(INPG, "YCOR:AS01:122:BDELTAS.L") field(INPH, "YCOR:AS01:122: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, "YCOR:AS01:122:STDZITOLR") field(INPC, "YCOR:AS01:122:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = MCOR:AS01:106: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, "YCOR:AS01:122: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 = MCOR:AS01:106:RESET PP # record(bo, "YCOR:AS01:122:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "MCOR:AS01:106:RESET PP") } record(bo, "YCOR:AS01:122:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "") 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, "YCOR:AS01:122: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, "YCOR:AS01:122:TRIMRAMPRATE") field(OUT, "") field(FLNK, "YCOR:AS01:122:STDZDLY") } record(ao, "YCOR:AS01:122:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(MDEL, "-1") field(OUT, "MCOR:AS01:106:ISETPT PP") field(DOL, "YCOR:AS01:122: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, "YCOR:AS01:122:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "YCOR:AS01:122:BMON") } record(ao, "YCOR:AS01:122:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "YCOR:AS01:122:IRIPLOK") } record(sub, "YCOR:AS01:122:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "YCOR:AS01:122:IRIPL.VAL") field(INPB, "YCOR:AS01:122: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, "YCOR:AS01:122: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, "YCOR:AS01:122:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") } record(bi, "YCOR:AS01:122:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "MCOR:AS01:106:INTLKSUMY NPP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "YCOR:AS01:122: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, "MCOR:AS01:106:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "YCOR:AS01:122:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "YCOR:AS01:122:IACTPREVOK") field(LNK2, "YCOR:AS01:122:IDIFF") field(LNK3, "YCOR:AS01:122:IADIFF") field(LNK4, "YCOR:AS01:122:IRATIO") field(LNK5, "YCOR:AS01:122:IDIRECT") field(LNK6, "YCOR:AS01:122:IACTPOL_CHECK") } record(calc, "YCOR:AS01:122:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "YCOR:AS01:122:IDES") field(INPB, "YCOR:AS01:122:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "6.0") field(LOPR, "-6.0") } record(calc, "YCOR:AS01:122:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "YCOR:AS01:122:IDIFF") field(PREC, "9") } record(calc, "YCOR:AS01:122:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "YCOR:AS01:122:IDIFF") field(INPB, "YCOR:AS01:122:IDES.DRVH") field(PREC, "9") } record(calcout, "YCOR:AS01:122:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "YCOR:AS01:122:IMIN") field(INPB, "YCOR:AS01:122: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, "YCOR:AS01:122: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, "YCOR:AS01:122:IACT") field(FLNK, "YCOR:AS01:122:IACTPOL") } record(bo, "YCOR:AS01:122:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "YCOR:AS01:122: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,"YCOR:AS01:122:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from YCOR:AS01:122:IDELTAS and the\n YCOR:AS01:122: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,"YCOR:AS01:122:IACT: \n Get copy of YCOR:AS01:122:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"YCOR:AS01:122: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,"YCOR:AS01:122:IDES:\n Contains raw value calculated by \nYCOR:AS01:122: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 \nYCOR:AS01:122:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"YCOR:AS01:122: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 YCOR:AS01:122: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 YCOR:AS01:122: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,"YCOR:AS01:122:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by YCOR:AS01:122:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, YCOR:AS01:122:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n YCOR:AS01:122: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, "YCOR:AS01:122:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "YCOR:AS01:122:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "YCOR:AS01:122:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "YCOR:AS01:122:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "YCOR:AS01:122:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "YCOR:AS01:122:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "0") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "YCOR:AS01:122: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, "YCOR:AS01:122:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "YCOR:AS01:122:TRIMTYPE.RVAL") field(INPB, "YCOR:AS01:122:CONFIG.RVAL") field(OUT, "YCOR:AS01:122:TRIMMAXNUM PP") } record(longout, "YCOR:AS01:122: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, "YCOR:AS01:122: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, "closed_loop") field(VAL, "1") field(OUT, "YCOR:AS01:122:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "YCOR:AS01:122: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, "closed_loop") field(VAL, "10") } record(bo, "YCOR:AS01:122: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, "YCOR:AS01:122: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, "YCOR:AS01:122:TRIMSTEPMIN") { field(DESC, "Min step in current") field(DTYP, "Soft Channel") field(DOL, "MCOR:AS01:106:ISTEP") field(PREC, "7") field(EGUF, "10") field(EGUL, "0") field(EGU, "A") field(HOPR, "10") field(LOPR, "0") field(VAL, "0.0001") } record(bo, "YCOR:AS01:122:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "1") } record(ao, "YCOR:AS01:122: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, "YCOR:AS01:122:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "YCOR:AS01:122: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, "YCOR:AS01:122: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, "YCOR:AS01:122:IMOVE") field(INPB, "YCOR:AS01:122:IACT") field(INPC, "YCOR:AS01:122:IRAMPRATE") field(INPD, "1.0") field(INPE, "YCOR:AS01:122:TRIMDLYPCT") field(INPF, "YCOR:AS01:122:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "YCOR:AS01:122:RAMPTIME_LEFT PP") } record(longout, "YCOR:AS01:122:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "YCOR:AS01:122:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "YCOR:AS01:122:RAMPDONE_CALC") } record(calc, "YCOR:AS01:122:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "YCOR:AS01:122:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "YCOR:AS01:122:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "YCOR:AS01:122: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, "YCOR:AS01:122:RAMPTIME_LEFT") field(OUT, "YCOR:AS01:122:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "YCOR:AS01:122:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "YCOR:AS01:122:RAMPTIME_LEFT NMS") field(OUT, "YCOR:AS01:122:RAMPDONE PP") } record(bo, "YCOR:AS01:122:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "YCOR:AS01:122:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "YCOR:AS01:122: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, "YCOR:AS01:122: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, "YCOR:AS01:122:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "YCOR:AS01:122:DEBUG.PROC PP") field(LNK2, "YCOR:AS01:122:STDZCYCLENUM.PROC PP") field(LNK3, "YCOR:AS01:122:STDZDISABLE.PROC PP") field(LNK4, "YCOR:AS01:122: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, "YCOR:AS01:122:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "YCOR:AS01:122:STDZIMIN NPP NMS") field(INPB, "YCOR:AS01:122:STDZIMAX NPP NMS") field(INPC, "YCOR:AS01:122:STDZIFINAL NPP NMS") field(INPD, "YCOR:AS01:122:STDZCYCLENUM NPP NMS") field(INPE, "YCOR:AS01:122:STDZDIRECT.RVAL NPP NMS") field(INPF, "YCOR:AS01:122:STDZDISABLE.RVAL CPP NMS") field(INPG, "YCOR:AS01:122: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, "YCOR:AS01:122:STDZWF PP") field(OUTB, "YCOR:AS01:122: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, "YCOR:AS01:122:STDZWF") } record(mbbo, "YCOR:AS01:122: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, "YCOR:AS01:122: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, "YCOR:AS01:122:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "YCOR:AS01:122: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, "YCOR:AS01:122: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, "YCOR:AS01:122: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, "YCOR:AS01:122:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "YCOR:AS01:122:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "YCOR:AS01:122:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "YCOR:AS01:122: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, "YCOR:AS01:122:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "YCOR:AS01:122:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "YCOR:AS01:122:STDZIMIN") } record(ao, "YCOR:AS01:122:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(VAL, "-6.0") field(FLNK, "YCOR:AS01:122:STDZIMAX") } record(ao, "YCOR:AS01:122:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(VAL, "6.0") field(FLNK, "YCOR:AS01:122:STDZIFINAL") } record(ao, "YCOR:AS01:122:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(VAL, "-6.0") field(FLNK, "YCOR:AS01:122: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, "YCOR:AS01:122: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, "YCOR:AS01:122:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "YCOR:AS01:122:STDZIMIN CP NMS") field(INPB, "YCOR:AS01:122:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "YCOR:AS01:122:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "YCOR:AS01:122:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "YCOR:AS01:122:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "YCOR:AS01:122:STDZIMIN CP NMS") field(INPB, "YCOR:AS01:122:STDZIMAX CP NMS") field(INPC, "YCOR:AS01:122:TRIMRAMPRATE CP NMS") field(INPD, "1.0") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "YCOR:AS01:122:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "YCOR:AS01:122:TRIMDLYPCT CP MS") field(INPB, "YCOR:AS01:122: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, "YCOR:AS01:122:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "YCOR:AS01:122: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, "YCOR:AS01:122:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "YCOR:AS01:122:IDES.HOPR") field(INPB, "YCOR:AS01:122:STDZMINIPCT CPP NMS") field(INPC, "YCOR:AS01:122:IDES.LOPR") field(PREC, "5") } record(calc, "YCOR:AS01:122:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "YCOR:AS01:122:IDES.HOPR") field(INPB, "YCOR:AS01:122:IDES.LOPR") field(INPC, "YCOR:AS01:122:STDZDIRECT.RVAL") field(INPD, "YCOR:AS01:122:STDZMINIDELTA") field(INPE, "YCOR:AS01:122:IDES") field(PREC, "5") field(FLNK, "YCOR:AS01:122: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, "YCOR:AS01:122:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "YCOR:AS01:122:IDES.HOPR") field(INPB, "YCOR:AS01:122:IDES.LOPR") field(INPC, "YCOR:AS01:122:STDZDIRECT.RVAL") field(INPD, "YCOR:AS01:122:STDZMINIDELTA") field(INPE, "YCOR:AS01:122: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, "YCOR:AS01:122: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, "YCOR:AS01:122:IADJUST.RVAL") field(INPB, "YCOR:AS01:122:STDZDIRECT.RVAL") field(INPC, "YCOR:AS01:122:STDZOK.RVAL") field(INPD, "YCOR:AS01:122:STDZDISABLE.RVAL") field(INPE, "YCOR:AS01:122:STATE.RVAL CPP NMS") field(INPF, "YCOR:AS01:122:ICTRL.RVAL") field(INPG, "YCOR:AS01:122:STATE.SEVR") field(INPH, "YCOR:AS01:122:BDELTAS.M") field(INPI, "YCOR:AS01:122:IACT.SEVR") field(OUT, "YCOR:AS01:122:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "YCOR:AS01:122:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "YCOR:AS01:122:STDZLOSTTOD.PROC") field(LNK2, "YCOR:AS01:122:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "YCOR:AS01:122:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "YCOR:AS01:122:CHECKPWRDIP_ENABLE") field(INPA, "YCOR:AS01:122:IACT CP") field(INPB, "YCOR:AS01:122:STDZIACTMAX") field(EGU, "A") field(FLNK, "YCOR:AS01:122: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, "YCOR:AS01:122:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "YCOR:AS01:122:CHECKPWRDIP_ENABLE") field(INPA, "YCOR:AS01:122:STDZIACTMAX") field(INPB, "YCOR:AS01:122:IACT") field(INPC, "YCOR:AS01:122:IDELTAS.I") field(OUT, "YCOR:AS01:122: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, "YCOR:AS01:122:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "YCOR:AS01:122:STDZOK.RVAL CP") field(INPB, "YCOR:AS01:122:STDZDISABLE.RVAL CP") field(INPC, "YCOR:AS01:122: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, "YCOR:AS01:122: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, "YCOR:AS01:122:CALBOK") { field(DESC, "Successful Calibration") field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "") 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, "YCOR:AS01:122:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "YCOR:AS01:122:CALBOK") field(INPB, "YCOR:AS01:122:CALBDISABLE") field(INPC, "YCOR:AS01:122:CALBSLOPE") field(OOPT, "On Change") field(OUT, "YCOR:AS01:122: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, "YCOR:AS01:122:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "YCOR:AS01:122: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, "YCOR:AS01:122:CALBSLOPE") field(DOL3, "YCOR:AS01:122:CALBOFFSET") field(DOL4, "0") field(DOL5, "0") field(LNK1, "MCOR:AS01:106:VSETPT.DISA PP NMS") field(LNK2, "MCOR:AS01:106:VSETPT.ASLO PP NMS") field(LNK3, "MCOR:AS01:106:VSETPT.AOFF PP NMS") field(LNK4, "MCOR:AS01:106:VSETPT.LINR PP NMS") field(LNK5, "MCOR:AS01:106:VSETPT.DISA PP NMS") # # 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, "MCOR:AS01:106:VSETPT.DISA PP NMS") field(LNK7, "MCOR:AS01:106:VSETPT.ASLO PP NMS") field(LNK8, "MCOR:AS01:106:VSETPT.AOFF PP NMS") field(LNK9, "MCOR:AS01:106:VSETPT.LINR PP NMS") field(LNKA, "MCOR:AS01:106:VSETPT.DISA PP NMS") } record(stringout, "YCOR:AS01:122:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "YCOR:AS01:122: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, "YCOR:AS01:122: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, "YCOR:AS01:122: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, "YCOR:AS01:122:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "YCOR:AS01:122: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, "YCOR:AS01:122:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "MCOR:AS01:106:VSETPT.ESLO") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "YCOR:AS01:122:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "YCOR:AS01:122:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "MCOR:AS01:106:VSETPT.EOFF") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "YCOR:AS01:122: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, "YCOR:AS01:122:CALCDAC") { field(DESC, "IACT to DAC Counts") field(CALC, "D=0?0:(((C*A)+B)-E)/D") field(INPA, "MCOR:AS01:106:I2VSLOPE") field(INPB, "0.0") field(INPC, "YCOR:AS01:122:IACT") field(INPD, "YCOR:AS01:122:DACSLOPE") field(INPE, "YCOR:AS01:122:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "YCOR:AS01:122:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "MCOR:AS01:106:VSETPT.RVAL CP") field(OMSL, "closed_loop") field(PREC, "6") field(PINI, "YES") } record(ao, "YCOR:AS01:122:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "6.0") field(HOPR, "6.0") field(DRVL, "-6.0") field(LOPR, "-6.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "YCOR:AS01:122:CALBIMAX") } record(ao, "YCOR:AS01:122:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "6.0") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVL, "-6.0") field(EGU, "A") field(VAL, "6.0") field(FLNK, "YCOR:AS01:122:CALBSTEPNUM") } record(ao, "YCOR:AS01:122:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(VAL, "0") } record(longout, "YCOR:AS01:122: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, "YCOR:AS01:122:CALBIDELTA") } record(calc, "YCOR:AS01:122:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "YCOR:AS01:122:CALBIMAX") field(INPB, "YCOR:AS01:122:CALBIMIN") field(INPC, "YCOR:AS01:122: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, "YCOR:AS01:122:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "MCOR:AS01:106:ISETPT.DRVH") field(INPB, "MCOR:AS01:106:IACT.HOPR") field(INPC, "YCOR:AS01:122:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "YCOR:AS01:122:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "YCOR:AS01:122:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "YCOR:AS01:122:DACSA") } # Used only for xygraph edm plot record(subArray, "YCOR:AS01:122:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "YCOR:AS01:122: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, "YCOR:AS01:122:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "YCOR:AS01:122:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "YCOR:AS01:122:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "YCOR:AS01:122: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, "YCOR:AS01:122:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "YCOR:AS01:122:CALBYSA") } # Used only for xygraph edm plot record(subArray, "YCOR:AS01:122:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "YCOR:AS01:122:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "YCOR:AS01:122:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "YCOR:AS01:122:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "YCOR:AS01:122:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "YCOR:AS01:122:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "YCOR:AS01:122:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "YCOR:AS01:122: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, "YCOR:AS01:122:CALBSTEPNUM") field(INPB, "YCOR:AS01:122:CALBIACTWF") field(INPC, "YCOR:AS01:122: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, "YCOR:AS01:122: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, "YCOR:AS01:122:STDZITOL") field(INPH, "YCOR:AS01:122:DACSLOPE") field(INPI, "YCOR:AS01:122: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, "YCOR:AS01:122: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, "YCOR:AS01:122:CALBSTEPNUM") field(INPB, "YCOR:AS01:122:CALBIACTWF") field(INPC, "YCOR:AS01:122:DACWF") field(INPF, "YCOR:AS01:122: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 YCOR:AS01:122CALBOK 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, "YCOR:AS01:122:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "YCOR:AS01:122:DEGAUSIMIN.PROC PP") field(OUTB, "YCOR:AS01:122:DEGAUSIMAX.PROC PP") field(OUTC, "YCOR:AS01:122:DEGAUSTYPE.PROC PP") field(OUTD, "YCOR:AS01:122:DEGAUSSTEP.PROC PP") field(OUTE, "YCOR:AS01:122:MADNAME.PROC PP") field(OUTF, "YCOR:AS01:122:PSTYPE.PROC PP") field(OUTG, "YCOR:AS01:122: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, "YCOR:AS01:122:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "YCOR:AS01:122:DEGAUSIMIN NPP NMS") field(INPB, "YCOR:AS01:122:DEGAUSIMAX NPP NMS") field(INPC, "YCOR:AS01:122:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "YCOR:AS01:122:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "YCOR:AS01:122:PSTYPE NPP NMS") field(INPG, "YCOR:AS01:122:DEBUG.RVAL NPP NMS") field(INPH, "YCOR:AS01:122: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, "YCOR:AS01:122:DEGAUSWF PP") field(OUTB, "YCOR:AS01:122:DEGAUSMSG PP") field(OUTC, "YCOR:AS01:122: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, "YCOR:AS01:122:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"YCOR:AS01:122: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, "YCOR:AS01:122: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, "YCOR:AS01:122: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, "YCOR:AS01:122: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, "YCOR:AS01:122: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, "YCOR:AS01:122:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(VAL, "-6.0") } record(ao, "YCOR:AS01:122:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(VAL, "6.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,"YCOR:AS01:122: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, "YCOR:AS01:122: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,"YCOR:AS01:122: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, "YCOR:AS01:122: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, "YCOR:AS01:122: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, "YCOR:AS01:122: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, "YCOR:AS01:122:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "YCOR:AS01:122:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "YCOR:AS01:122:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "YCOR:AS01:122:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "YCOR:AS01:122: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, "YCOR:AS01:122:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "YCOR:AS01:122: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, "YCOR:AS01:122:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "YCOR:AS01:122:DEGAUS_IMAX") field(INPB, "YCOR:AS01:122:ISETPT") field(INPC, "YCOR:AS01:122:DEGAUSTYPE.RVAL") field(OUT, "YCOR:AS01:122:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "YCOR:AS01:122:DEGAUS_IMAX_UPDATE") } record(seq, "YCOR:AS01:122:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "YCOR:AS01:122:ISETPT") field(LNK1, "YCOR:AS01:122:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "YCOR:AS01:122:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(VAL, "6.0") field(FLNK, "YCOR:AS01:122:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "YCOR:AS01:122:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "YCOR:AS01:122:DEGAUS_IMAX") field(FLNK, "YCOR:AS01:122:DEGAUS_IMAXPOL") } record(bo, "YCOR:AS01:122:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "YCOR:AS01:122:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "YCOR:AS01:122: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, "YCOR:AS01:122:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "YCOR:AS01:122:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "6.0") field(LOPR, "-6.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "YCOR:AS01:122:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "YCOR:AS01:122:IACT") field(INPB, "YCOR:AS01:122:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "YCOR:AS01:122:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "YCOR:AS01:122:IACTPOL") } record(bo, "YCOR:AS01:122: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,"YCOR:AS01:122: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, "YCOR:AS01:122:DEGAUSENABLE CP") field(INPB, "YCOR:AS01:122:DEGAUSOK") field(INPC, "YCOR:AS01:122:STATE CP") field(INPD, "YCOR:AS01:122:STATE.SEVR") field(OUT, "YCOR:AS01:122:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "YCOR:AS01:122:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "YCOR:AS01:122:DEGAUS_STATE_CHECK") field(LNK1, "YCOR:AS01:122:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "YCOR:AS01:122:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "YCOR:AS01:122:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "YCOR:AS01:122: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, "YCOR:AS01:122:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "YCOR:AS01:122:DEGAUSOK.ZSV") field(LNK2, "YCOR:AS01:122: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, "YCOR:AS01:122:STATMSG.FRSV") field(LNK4, "YCOR:AS01:122: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, "YCOR:AS01:122:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "YCOR:AS01:122:DEGAUSOK.ZSV") field(LNK2, "YCOR:AS01:122: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, "YCOR:AS01:122:STATMSG.FRSV") field(LNK4, "YCOR:AS01:122: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, "YCOR:AS01:122:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "YCOR:AS01:122: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, "YCOR:AS01:122:STATMSG.FRSV") field(LNK3, "YCOR:AS01:122: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, "YCOR:AS01:122:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "YCOR:AS01:122: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, "YCOR:AS01:122:STATMSG.FRSV PP") field(LNK3, "YCOR:AS01:122:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "YCOR:AS01:122:FUNC") { field(DESC, "YCOR:AS01:122 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, "0") field(NIVL, "0") field(TEVL, "0") field(ELVL, "5") field(TVVL, "6") field(TTVL, "7") field(FTVL, "4") field(FFVL, "3") field(OUT, "YCOR:AS01:122:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "YCOR:AS01:122:CTRL") { field(DESC, "YCOR:AS01:122 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, "") field(TVST, "") field(TTST, "") 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, "0") field(TVVL, "0") field(TTVL, "0") field(FTVL, "0") field(FFVL, "0") field(OUT, "YCOR:AS01:122:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "YCOR:AS01:122:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "YCOR:AS01:122:BUSY") } # Set to FREE on IOC reboot record(bo, "YCOR:AS01:122:BUSY") { field(DESC, "YCOR:AS01:122 Ctrl Done") field(DOL, "YCOR:AS01:122:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "YCOR:AS01:122:SELECT") } record(bo, "YCOR:AS01:122:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "YCOR:AS01:122: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, "YCOR:AS01:122:CTRLSTATE") { field(DESC, "YCOR:AS01:122 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("YCOR:AS01:122:CTRL",20,20,0,0,"YCOR:AS01:122:CTRL") #! Field("YCOR:AS01:122:CTRL.OUT",16777215,1,"YCOR:AS01:122:CTRL.OUT") #! Link("YCOR:AS01:122:CTRL.OUT","YCOR:AS01:122:SELECTEN.A") #! Field("YCOR:AS01:122:CTRL.VAL",16777215,1,"YCOR:AS01:122:CTRL.VAL") #! Record("YCOR:AS01:122:SELECTEN",321,381,0,0,"YCOR:AS01:122:SELECTEN") #! Field("YCOR:AS01:122:SELECTEN.A",16777215,0,"YCOR:AS01:122:SELECTEN.A") #! Field("YCOR:AS01:122:SELECTEN.FLNK",16777215,1,"YCOR:AS01:122:SELECTEN.FLNK") #! Link("YCOR:AS01:122:SELECTEN.FLNK","YCOR:AS01:122:BUSY") #! Field("YCOR:AS01:122:SELECTEN.VAL",16777215,1,"YCOR:AS01:122:SELECTEN.VAL") #! Record("YCOR:AS01:122:BUSY",623,274,0,0,"YCOR:AS01:122:BUSY") #! Field("YCOR:AS01:122:BUSY.DOL",16777215,0,"YCOR:AS01:122:BUSY.DOL") #! Link("YCOR:AS01:122:BUSY.DOL","YCOR:AS01:122:SELECTEN.VAL") #! Field("YCOR:AS01:122:BUSY.FLNK",16777215,1,"YCOR:AS01:122:BUSY.FLNK") #! Link("YCOR:AS01:122:BUSY.FLNK","YCOR:AS01:122:SELECT") #! Record("YCOR:AS01:122:SELECT",669,508,0,1,"YCOR:AS01:122:SELECT") #! Record("YCOR:AS01:122:FUNC",940,120,0,0,"YCOR:AS01:122:FUNC") #! Field("YCOR:AS01:122:FUNC.OUT",16777215,0,"YCOR:AS01:122:FUNC.OUT") #! Link("YCOR:AS01:122:FUNC.OUT","YCOR:AS01:122:CTRL.VAL") #! Record("YCOR:AS01:122:ABORT",193,41,0,0,"YCOR:AS01:122:ABORT") #! Record("YCOR:AS01:122:CTRLSTATE",369,34,0,0,"YCOR:AS01:122: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,"YCOR:AS01:122:SELECT is used for Multi-device selection.\nIt is enabled when associated YCOR:AS01:122:CTRL is \"0\" (DONE).\nIt is disabled when associated YCOR:AS01:122: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,"YCOR:AS01:122: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, "YCOR:AS01:122:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "YCOR:AS01:122:BCTRL.SEVR") field(OUT, "YCOR:AS01:122: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, "YCOR:AS01:122:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "YCOR:AS01:122:BACT") field(INPB, "YCOR:AS01:122:POLYCOEF") field(INPC, "YCOR:AS01:122:POLYCOEF.A") field(INPD, "YCOR:AS01:122:POLYCOEF.B") field(INPE, "YCOR:AS01:122:IACT MS") field(INPF, "YCOR:AS01:122:BDELTAS PP") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "220.0") field(LOPR, "-220.0") field(HIHI, "220.0") field(LOLO, "-220.0") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "220.0") field(LOW, "-220.0") field(FLNK, "YCOR:AS01:122: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, "YCOR:AS01:122: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, "YCOR:AS01:122:BDES") field(INPB, "YCOR:AS01:122:TRIMBTOL") field(INPC, "YCOR:AS01:122:TRIMBTOLR") field(INPD, "YCOR:AS01:122:CHCKBTOL") field(INPE, "YCOR:AS01:122:CHCKBTOLR") field(F, "0.0") field(INPG, "30") field(INPH, "YCOR:AS01:122:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "YCOR:AS01:122:MPSBTOL") field(INPQ, "YCOR:AS01:122:MPSBTOLR") field(FLNK, "YCOR:AS01:122:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "YCOR:AS01:122:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "YCOR:AS01:122:BDES") field(INPB, "YCOR:AS01:122:BDELTAS.I") field(INPG, "YCOR:AS01:122:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "YCOR:AS01:122:BCON.HIGH") field(OUTB, "YCOR:AS01:122:BCON.LOW") field(OUTC, "YCOR:AS01:122:BCON.HIHI") field(OUTD, "YCOR:AS01:122:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "YCOR:AS01:122:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "YCOR:AS01:122:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "YCOR:AS01:122:BDIFF") field(LNK2, "YCOR:AS01:122:BADIFF") field(LNK3, "YCOR:AS01:122:BRATIO") field(LNK4, "YCOR:AS01:122:MPSLIMITS") field(LNK5, "YCOR:AS01:122:I2BSTATUS") field(LNK6, "YCOR:AS01:122:IACTFO.PROC") } record(calc, "YCOR:AS01:122:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "YCOR:AS01:122:BDES") field(INPB, "YCOR:AS01:122:BACT") field(EGU, "kG-m") field(PREC, "7") } record(calc, "YCOR:AS01:122:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "YCOR:AS01:122:BDIFF") field(EGU, "kG-m") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "YCOR:AS01:122:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "YCOR:AS01:122:BDIFF") field(INPB, "YCOR:AS01:122:BDES.HOPR") field(EGU, "kG-m") field(PREC, "7") } record(mbbi, "YCOR:AS01:122: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, "YCOR:AS01:122:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "YCOR:AS01:122:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "YCOR:AS01:122:BMON") field(INPB, "YCOR:AS01:122:POLYCOEF") field(INPC, "YCOR:AS01:122:POLYCOEF.A") field(INPD, "YCOR:AS01:122:POLYCOEF.B") field(INPE, "YCOR:AS01:122:IMON MS") field(INPF, "YCOR:AS01:122:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "220.0") field(LOPR, "-220.0") field(HIHI, "220.0") field(LOLO, "-220.0") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "220.0") field(LOW, "-220.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=MCOR:AS01:106:BDES CP record(ao, "YCOR:AS01:122:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "220.0") field(DRVL, "-220.0") field(HOPR, "220.0") field(LOPR, "-220.0") field(PREC, "7") field(EGU, "kG-m") field(MDEL, "-1") field(OMSL, "supervisory") # field(DOL, "") field(OUT, "YCOR:AS01:122:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "YCOR:AS01:122:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "YCOR:AS01:122:POLYCOEF") field(INPC, "YCOR:AS01:122:POLYCOEF.A") field(INPD, "YCOR:AS01:122:POLYCOEF.B") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "220.0") field(LOPR, "-220.0") field(MDEL, "-1") field(INPE, "YCOR:AS01:122:BDES.DRVH") field(INPF, "YCOR:AS01:122:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "YCOR:AS01:122:IDES") } record(sub, "YCOR:AS01:122:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "YCOR:AS01:122:POLYCOEF") field(INPC, "YCOR:AS01:122:POLYCOEF.A") field(INPD, "YCOR:AS01:122:POLYCOEF.B") field(INPE, "YCOR:AS01:122:BDES.DRVH") field(INPF, "YCOR:AS01:122:BDES.DRVL") field(EGU, "kG-m") field(HOPR, "220.0") field(LOPR, "-220.0") field(PREC, "7") field(VAL, "0.0") field(FLNK, "YCOR:AS01:122:INOM") } record(sub, "YCOR:AS01:122:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "YCOR:AS01:122:BDES.VAL") field(INPB, "YCOR:AS01:122:BDES.DRVH") field(INPC, "YCOR:AS01:122:BDES.DRVL") field(INPD, "YCOR:AS01:122:BDELTAS.I") field(INPE, "YCOR:AS01:122:BDELTAS.J") field(INPG, "YCOR:AS01:122:STATE") field(INPH, "YCOR:AS01:122:HSTA") field(EGU, "kG-m") field(HOPR, "220.0") field(LOPR, "-220.0") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "YCOR:AS01:122:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "YCOR:AS01:122:BDES.VAL") field(INPB, "YCOR:AS01:122:BDES.DRVH") field(INPC, "YCOR:AS01:122:BDES.DRVL") field(INPD, "YCOR:AS01:122:BDELTAS.K") field(INPE, "YCOR:AS01:122:BDELTAS.L") field(INPG, "YCOR:AS01:122:STATE") field(INPH, "YCOR:AS01:122:HSTA") field(EGU, "kG-m") field(HOPR, "220.0") field(LOPR, "-220.0") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "YCOR:AS01:122:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "YCOR:AS01:122:BLIMITS") field(LNK1, "YCOR:AS01:122:BACTLIMITS.F PP") field(DOL2, "YCOR:AS01:122:BACTLIMITS.I") field(LNK2, "YCOR:AS01:122:BACT.HIGH") field(DOL3, "YCOR:AS01:122:BACTLIMITS.J") field(LNK3, "YCOR:AS01:122:BACT.LOW") field(DOL4, "YCOR:AS01:122:BACTLIMITS.K") field(LNK4, "YCOR:AS01:122:BACT.HIHI") field(DOL5, "YCOR:AS01:122:BACTLIMITS.L") field(LNK5, "YCOR:AS01:122:BACT.LOLO") field(DOL6, "YCOR:AS01:122:BLIMITS") field(LNK6, "YCOR:AS01:122:BMONLIMITS.F PP") field(DOL7, "YCOR:AS01:122:BMONLIMITS.I") field(LNK7, "YCOR:AS01:122:BMON.HIGH") field(DOL8, "YCOR:AS01:122:BMONLIMITS.J") field(LNK8, "YCOR:AS01:122:BMON.LOW") field(DOL9, "YCOR:AS01:122:BMONLIMITS.K") field(LNK9, "YCOR:AS01:122:BMON.HIHI") field(DOLA, "YCOR:AS01:122:BMONLIMITS.L") field(LNKA, "YCOR:AS01:122:BMON.LOLO") field(FLNK, "YCOR:AS01:122:ILIMITS") field(SCAN, "5 second") } record(ao, "YCOR:AS01:122:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG-m") field(DRVH, "220.0") field(DRVL, "-220.0") field(HOPR, "220.0") field(LOPR, "-220.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, "YCOR:AS01:122: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, "YCOR:AS01:122:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "YCOR:AS01:122:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "YCOR:AS01:122:BCTRL.VAL") field(LNK2, "YCOR:AS01:122:BDES PP") field(DOL3, "1") field(LNK3, "YCOR:AS01:122:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "YCOR:AS01:122:CHECKSTDZLOST.PROC PP") field(DOL5, "YCOR:AS01:122:BCTRL.VAL") field(LNK5, "YCOR:AS01:122:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "YCOR:AS01:122:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "YCOR:AS01:122:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "YCOR:AS01:122:POLYCOEF") field(INPC, "YCOR:AS01:122:POLYCOEF.A") field(INPD, "YCOR:AS01:122:POLYCOEF.B") field(INPE, "YCOR:AS01:122:BDES.DRVH") field(INPF, "YCOR:AS01:122:BDES.DRVL") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "220.0") field(LOPR, "-220.0") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "YCOR:AS01:122:ISETPT") } record(ao, "YCOR:AS01:122:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "220.0") field(DRVL, "-220.0") field(EGU, "kG-m") field(HOPR, "220.0") field(LOPR, "-220.0") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "YCOR:AS01:122:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "YC00S") } record(ai, "YCOR:AS01:122: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, "2018.072") } record(ao, "YCOR:AS01:122:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "220.0") field(DRVL, "-220.0") field(EGU, "kG-m") field(HOPR, "220.0") field(LOPR, "-220.0") field(PREC, "7") field(PINI, "YES") field(VAL, "220.0") field(FLNK, "YCOR:AS01:122:BSTEP") } record(ao, "YCOR:AS01:122:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "220.0") field(DRVL, "-220.0") field(EGU, "kG-m") field(HOPR, "220.0") field(LOPR, "-220.0") field(PREC, "7") field(PINI, "YES") field(VAL, "-220.0") field(FLNK, "YCOR:AS01:122:BSTEP") } record(ao, "YCOR:AS01:122:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "220.0") field(DRVL, "-220.0") field(EGU, "kG-m") field(HOPR, "220.0") field(LOPR, "-220.0") field(PINI, "YES") field(PREC, "7") } # This record is processed by YCOR:AS01:122: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, "YCOR:AS01:122:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "220.0") field(LOPR, "-220.0") field(DRVH, "220.0") field(DRVL, "-220.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, "YCOR:AS01:122:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "YCOR:AS01:122:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "YCOR:AS01:122:POLYCOEF") field(INPC, "YCOR:AS01:122:POLYCOEF.A") field(INPD, "YCOR:AS01:122:POLYCOEF.B") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "220.0") field(LOPR, "-220.0") field(MDEL, "-1") field(INPE, "YCOR:AS01:122:BCON.DRVH") field(INPF, "YCOR:AS01:122:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "YCOR:AS01:122: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, "YCOR:AS01:122:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "YCOR:AS01:122:BMAX") field(INPB, "YCOR:AS01:122:BMIN") field(INPC, "YCOR:AS01:122:BMIN.SEVR") field(INPD, "YCOR:AS01:122: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,"YCOR:AS01:122:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "YCOR:AS01:122:ONLINE CP") field(OUT, "YCOR:AS01:122:BCTRLDISABLEFOUT PP") } record(fanout, "YCOR:AS01:122:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "YCOR:AS01:122:BCTRLDISABLECALC") field(LNK1, "YCOR:AS01:122:BCTRLDISABLE") field(LNK2, "YCOR:AS01:122:BCTRLENABLE") } record(stringout, "YCOR:AS01:122:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "YCOR:AS01:122:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "YCOR:AS01:122:BCTRLDISV_UPDATE") } record(stringout, "YCOR:AS01:122:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "YCOR:AS01:122:BCTRL.ASG") field(VAL, "") field(FLNK, "YCOR:AS01:122:BCTRLDISV_UPDATE") } record(calcout, "YCOR:AS01:122:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "YCOR:AS01:122:ONLINE") field(OUT, "YCOR:AS01:122: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,"YCOR:AS01:122:BACT and MON\n are processed via links from \n YCOR:AS01:122:IACT (device raw value readback 1)\n and\n YCOR:AS01:122: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 YCOR:AS01:122:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = YCOR:AS01:122: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,"YCOR:AS01:122:BDES\n is processed when set by CA users or \n YCOR:AS01:122: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,"YCOR:AS01:122: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 YCOR:AS01:122: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 (YCOR:AS01:122: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,"YCOR:AS01:122:B*LIMITS and YCOR:AS01:122:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from YCOR:AS01:122: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,"YCOR:AS01:122: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,"YCOR:AS01:122: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, "YCOR:AS01:122: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, "YCOR:AS01:122:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG-m") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "YCOR:AS01:122:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "YCOR:AS01:122:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "220.0") field(DRVL, "-220.0") field(PINI, "YES") field(VAL, "220.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "YCOR:AS01:122:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "220.0") field(DRVL, "-220.0") field(PINI, "YES") field(VAL, "-220.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "YCOR:AS01:122:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "220.0") field(DRVL, "-220.0") field(PINI, "YES") field(VAL, "-220.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "YCOR:AS01:122:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "220.0") field(DRVL, "-220.0") field(PINI, "YES") field(VAL, "-220.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "YCOR:AS01:122: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, "YCOR:AS01:122:MPSLIMITS.E PP") } record(aSub, "YCOR:AS01:122: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, "YCOR:AS01:122:MPS.RVAL") field(INPB, "YCOR:AS01:122:BADIFF") field(INPC, "YCOR:AS01:122:BDELTAS.N") field(INPD, "YCOR:AS01:122:BACT") field(INPE, "YCOR:AS01:122:MPSBITMASK.RVAL") field(INPF, "YCOR:AS01:122:MPSBLLIM") field(INPG, "YCOR:AS01:122:MPSBMIN") field(INPH, "YCOR:AS01:122:MPSBMAX") field(INPI, "YCOR:AS01:122: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, "YCOR:AS01:122:INTOL.RVAL PP") field(OUTB, "YCOR:AS01:122:INTOL_BMIN.RVAL PP") field(OUTC, "YCOR:AS01:122:INTOL_BRANGE.RVAL PP") field(OUTD, "YCOR:AS01:122: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, "YCOR:AS01:122:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "YCOR:AS01:122:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "YCOR:AS01:122:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "YCOR:AS01:122:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "YCOR:AS01:122:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "YCOR:AS01:122:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "YCOR:AS01:122:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "YCOR:AS01:122: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, "YCOR:AS01:122:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "YCOR:AS01:122:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "YCOR:AS01:122:CHCKBTOL") field(INPB, "YCOR:AS01:122:POLYCOEF.B") field(PREC, "9") } record(calc, "YCOR:AS01:122: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, "YCOR:AS01:122:CHCKBTOL") field(FLNK, "YCOR:AS01:122:CHCKITOL") } record(calc, "YCOR:AS01:122:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "YCOR:AS01:122:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "YCOR:AS01:122:BDES.HOPR") field(INPB, "YCOR:AS01:122:STABILITY") field(INPC, "YCOR:AS01:122:BDES.LOPR") } record(longout, "YCOR:AS01:122:STABILITY") { field(DESC, "Long Term Stability") field(PINI, "YES") field(VAL, "1000") field(EGU, "ppm") field(DRVH, "3000") field(DRVL, "100") field(HOPR, "3000") field(LOPR, "100") field(FLNK, "YCOR:AS01:122:CHCKBTOL") } record(calc, "YCOR:AS01:122:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG-m") field(CALC, "ABS(A*B)") field(INPA, "YCOR:AS01:122:POLYCOEF.B") field(INPB, "YCOR:AS01:122:TRIMBTOL") field(PREC, "9") } record(ai, "YCOR:AS01:122:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "YCOR:AS01:122: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, "YCOR:AS01:122:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "YCOR:AS01:122:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "YCOR:AS01:122:PAUGO") } record(fanout, "YCOR:AS01:122:PAUGO") { field(DESC, "PAU control") field(LNK1, "YCOR:AS01:122:PAUSTOP") field(LNK2, "YCOR:AS01:122: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, "YCOR:AS01:122:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "YCOR:AS01:122:PAU.RVAL") field(DISV, "0") field(DOL1, "0") field(DOL2, "0") field(DOL3, "1") field(DLY3, "1") # field(LNK1, "MCOR:AS01:106:ISETPT.DISV") # field(LNK2, "MCOR:AS01:106:VSETPT.DISV") # field(LNK3, "ACTPAU PP") } record(seq, "YCOR:AS01:122:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "YCOR:AS01:122:PAU.RVAL") field(DISV, "1") field(DOL1, "1") field(DOL2, "1") field(DOL3, "0") # field(LNK1, "MCOR:AS01:106:ISETPT.DISV") # field(LNK2, "MCOR:AS01:106:VSETPT.DISV") # field(LNK3, "ACTPAU PP") } # Change attribute to PSDEVNAME record(stringout, "YCOR:AS01:122:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "MCOR:AS01:106:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "YCOR:AS01:122: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, "YCOR:AS01:122:PSTYPE.RVAL") field(INPC, "YCOR:AS01:122:TURNEDOFF.RVAL") field(INPD, "YCOR:AS01:122:CONFIG.RVAL") field(INPE, "YCOR:AS01:122:PSCATEGORY.RVAL") field(INPF, "YCOR:AS01:122:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "YCOR:AS01:122:AUTOCTRL.RVAL") field(INPJ, "YCOR:AS01:122:OUTOFSERVICE.RVAL") field(INPL, "YCOR:AS01:122:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "YCOR:AS01:122:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "YCOR:AS01:122:PAU") field(INPP, "YCOR:AS01:122:CALBDISABLE.RVAL") field(INPQ, "YCOR:AS01:122:PTRBDISABLE.RVAL") field(INPR, "YCOR:AS01:122:TRIMDISABLE.RVAL") field(INPS, "YCOR:AS01:122:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "YCOR:AS01:122:FBCK") field(INPU, "YCOR:AS01:122:TRIMTYPE.RVAL") field(INPV, "YCOR:AS01:122:STDZDIRECT.RVAL") field(INPW, "YCOR:AS01:122:DEGAUSENABLE.RVAL") field(FLNK, "YCOR:AS01:122:HSTA") } record(longin, "YCOR:AS01:122:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "YCOR:AS01:122:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "YCOR:AS01:122: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, "YCOR:AS01:122: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, "YCOR:AS01:122: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, "YCOR:AS01:122: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, "YCOR:AS01:122: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, "YCOR:AS01:122: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 YCOR:AS01:122:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses YCOR:AS01:122:FBCK. # This PV should be replaced by YCOR:AS01:122: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, "YCOR:AS01:122: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, "YCOR:AS01:122: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, "YCOR:AS01:122: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, "YCOR:AS01:122:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"YCOR:AS01:122:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "YCOR:AS01:122:OUTOFSERVICE NPP NMS") field(OUT, "YCOR:AS01:122:ONLINE PP") } record(bo, "YCOR:AS01:122:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "YCOR:AS01:122: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, "YCOR:AS01:122: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, "YCOR:AS01:122: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, "YCOR:AS01:122: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, "YCOR:AS01:122: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, "YCOR:AS01:122: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, "YCOR:AS01:122: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, "YCOR:AS01:122: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, "YCOR:AS01:122: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, "0") field(ASG, "NOWRITE") } record(mbbo, "YCOR:AS01:122: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, "0") field(ASG, "NOWRITE") } record(mbbo, "YCOR:AS01:122: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, "YCOR:AS01:122:TRIMTYPE") } record(stringout, "YCOR:AS01:122:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "YCOR:AS01:122:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "YCOR:AS01:122:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "YCOR:AS01:122:STATE.RVAL") field(INPB, "YCOR:AS01:122:INTLKSUMY.RVAL") field(OUT, "YCOR:AS01:122:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "YCOR:AS01:122: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, "YCOR:AS01:122:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "YCOR:AS01:122:STATE.RVAL") field(INPB, "YCOR:AS01:122:INTLKSUMY.RVAL") field(OUT, "YCOR:AS01:122:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "YCOR:AS01:122:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "YCOR:AS01:122:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "YCOR:AS01:122: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, "YCOR:AS01:122: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, "YCOR:AS01:122: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, "YCOR:AS01:122: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,"YCOR:AS01:122: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("YCOR:AS01:122:TURNEDOFF",3140,1907,0,1,"YCOR:AS01:122:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "YCOR:AS01:122:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "YCOR:AS01:122:BACT.STAT") field(INPB, "YCOR:AS01:122:BDES.STAT") field(INPC, "YCOR:AS01:122:IRIPL.STAT") field(INPD, "MCOR:AS01:106:VSETPT.STAT") field(INPE, "MCOR:AS01:106:VACT.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, "YCOR:AS01:122:BACT.SEVR") field(INPH, "YCOR:AS01:122:BDES.SEVR") field(INPI, "YCOR:AS01:122:IRIPL.SEVR") field(INPJ, "MCOR:AS01:106:VSETPT.SEVR") field(INPK, "MCOR:AS01:106:VACT.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, "YCOR:AS01:122:STATE.RVAL") field(INPN, "YCOR:AS01:122:STDZOK") field(INPO, "YCOR:AS01:122:CALBOK") field(INPP, "YCOR:AS01:122:OUTOFSERVICE.RVAL") field(INPQ, "YCOR:AS01:122:CONFIG.RVAL") field(INPR, "YCOR:AS01:122:HSTA") field(INPS, "YCOR:AS01:122:CTRL.RVAL") field(INPT, "YCOR:AS01:122:DEGAUSOK") field(INPV, "YCOR:AS01:122: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, "YCOR:AS01:122:STAT") } record(longout, "YCOR:AS01:122:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "YCOR:AS01:122:STATCTRLSUB") field(DOL, "YCOR:AS01:122:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "YCOR:AS01:122:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "YCOR:AS01:122:STAT") field(INPB, "YCOR:AS01:122:HSTA") field(INPD, "YCOR:AS01:122:ONOFFCTRL.RVAL") field(FLNK, "YCOR:AS01:122:STATMSG") } record(mbbo, "YCOR:AS01:122: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, "YCOR:AS01:122:UNAVAILGO") field(DOL, "YCOR:AS01:122:STATCTRLSUB.W") } record(seq, "YCOR:AS01:122:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "YCOR:AS01:122:STATSUB.U") field(LNK1, "YCOR:AS01:122:UNAVAIL PP") } record(stringout, "YCOR:AS01:122:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"YCOR:AS01:122:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - YCOR:AS01:122:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - YCOR:AS01:122: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,"YCOR:AS01:122STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - YCOR:AS01:122:STATUS\nC - YCOR:AS01:122:ON\nD - YCOR:AS01:122:STDZOK\nE - YCOR:AS01:122:CALBOK\nF - YCOR:AS01:122:BACTDRIFT (future)\nG -\nH- YCOR:AS01:122:DACSTATUS\nI -YCOR:AS01:122:ADCSTATUS\nJ - YCOR:AS01:122:BACTSTATUS\nK - YCOR:AS01:122:BDESSTATUS\nL - YCOR:AS01:122:RIPLSTATUS\n\nOutput:\nP - YCOR:AS01:122: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, "YCOR:AS01:122: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, "YCOR:AS01:122: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, "YCOR:AS01:122: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, "YCOR:AS01:122: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 # Note: for slave with trim coils # set the macro ACT to the following: # ACT=:IACTCALC record(ai, "XCOR:AS01:221:IACT") { field(DESC, "Current") field(INP, "MCOR:AS01:107:IACT") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "XCOR:AS01:221:BACT") info(autosaveFields,"HYST") } record(bi, "XCOR:AS01:221:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "MCOR:AS01:107:STATE NPP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "XCOR:AS01:221:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "6.0") field(LOLO, "-6.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "XCOR:AS01:221:BDELTAS") field(DRVH, "6.0") field(DRVL, "-6.0") field(DOL, "XCOR:AS01:221: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, "XCOR:AS01:221:ICTRL PP") } # This record is processed by XCOR:AS01:221:ICON") # Note: we are not setting alarms here. record(ao, "XCOR:AS01:221:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(DOL, "XCOR:AS01:221:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "XCOR:AS01:221:INOM") { field(DESC, "Nominal Current") field(DOL, "XCOR:AS01:221:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "6.0") field(DRVL, "-6.0") field(HOPR, "6.0") field(LOPR, "-6.0") } record(ao, "XCOR:AS01:221:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(MDEL, "-1") field(FLNK, "XCOR:AS01:221:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "XCOR:AS01:221:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "XCOR:AS01:221:ISETPT.OMSL") field(DOL2, "XCOR:AS01:221:ICTRL") field(LNK2, "XCOR:AS01:221:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "XCOR:AS01:221:ISETPT.OMSL") } record(ao, "XCOR:AS01:221:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "6.0") field(DRVL, "-6.0") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(PINI, "YES") field(VAL, "6.0") field(FLNK, "XCOR:AS01:221:IMIN") } record(ao, "XCOR:AS01:221:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "6.0") field(DRVL, "-6.0") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(VAL, "-6.0") field(FLNK, "XCOR:AS01:221:IRANGE") } record(sel, "XCOR:AS01:221:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(NVL, "XCOR:AS01:221:BACT.SEVR") field(INPA, "XCOR:AS01:221:IACT NPP MS") field(INPB, "XCOR:AS01:221:IACTPREVOK NPP MS") field(INPC, "XCOR:AS01:221:IACTPREVOK NPP MS") field(INPD, "XCOR:AS01:221:IACTPREVOK NPP MS") } record(sub, "XCOR:AS01:221:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "XCOR:AS01:221:IDES") field(INPB, "XCOR:AS01:221:ISETPT.DRVH") field(INPC, "XCOR:AS01:221:ISETPT.DRVL") field(INPD, "XCOR:AS01:221:IDELTAS.I") field(INPE, "XCOR:AS01:221:IDELTAS.J") field(INPG, "XCOR:AS01:221:STATE") field(INPH, "XCOR:AS01:221:HSTA") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "XCOR:AS01:221:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "XCOR:AS01:221:IDES") field(INPB, "XCOR:AS01:221:ISETPT.DRVH") field(INPC, "XCOR:AS01:221:ISETPT.DRVL") field(INPD, "XCOR:AS01:221:IDELTAS.K") field(INPE, "XCOR:AS01:221:IDELTAS.L") field(INPG, "XCOR:AS01:221:STATE") field(INPH, "XCOR:AS01:221:HSTA") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "XCOR:AS01:221:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "XCOR:AS01:221:BLIMITS") field(LNK1, "XCOR:AS01:221:IACTLIMITS.F PP") field(DOL2, "XCOR:AS01:221:IACTLIMITS.I") field(LNK2, "XCOR:AS01:221:IACT.HIGH") field(DOL3, "XCOR:AS01:221:IACTLIMITS.J") field(LNK3, "XCOR:AS01:221:IACT.LOW") field(DOL4, "XCOR:AS01:221:IACTLIMITS.K") field(LNK4, "XCOR:AS01:221:IACT.HIHI") field(DOL5, "XCOR:AS01:221:IACTLIMITS.L") field(LNK5, "XCOR:AS01:221:IACT.LOLO") field(DOL6, "XCOR:AS01:221:BLIMITS") field(LNK6, "XCOR:AS01:221:IMONLIMITS.F PP") field(DOL7, "XCOR:AS01:221:IMONLIMITS.I") field(LNK7, "XCOR:AS01:221:IMON.HIGH") field(DOL8, "XCOR:AS01:221:IMONLIMITS.J") field(LNK8, "XCOR:AS01:221:IMON.LOW") field(DOL9, "XCOR:AS01:221:IMONLIMITS.K") field(LNK9, "XCOR:AS01:221:IMON.HIHI") field(DOLA, "XCOR:AS01:221:IMONLIMITS.L") field(LNKA, "XCOR:AS01:221: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, "XCOR:AS01:221:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "XCOR:AS01:221:TRIMBTOL") field(INPE, "XCOR:AS01:221:CHCKBTOL") field(INPF, "XCOR:AS01:221:BDELTAS.K") field(INPG, "XCOR:AS01:221:BDELTAS.L") field(INPH, "XCOR:AS01:221: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, "XCOR:AS01:221:STDZITOLR") field(INPC, "XCOR:AS01:221:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = MCOR:AS01:107: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, "XCOR:AS01:221: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 = MCOR:AS01:107:RESET PP # record(bo, "XCOR:AS01:221:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "MCOR:AS01:107:RESET PP") } record(bo, "XCOR:AS01:221:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "") 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, "XCOR:AS01:221: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, "XCOR:AS01:221:TRIMRAMPRATE") field(OUT, "") field(FLNK, "XCOR:AS01:221:STDZDLY") } record(ao, "XCOR:AS01:221:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(MDEL, "-1") field(OUT, "MCOR:AS01:107:ISETPT PP") field(DOL, "XCOR:AS01:221: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, "XCOR:AS01:221:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "XCOR:AS01:221:BMON") } record(ao, "XCOR:AS01:221:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "XCOR:AS01:221:IRIPLOK") } record(sub, "XCOR:AS01:221:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "XCOR:AS01:221:IRIPL.VAL") field(INPB, "XCOR:AS01:221: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, "XCOR:AS01:221: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, "XCOR:AS01:221:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") } record(bi, "XCOR:AS01:221:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "MCOR:AS01:107:INTLKSUMY NPP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "XCOR:AS01:221: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, "MCOR:AS01:107:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "XCOR:AS01:221:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "XCOR:AS01:221:IACTPREVOK") field(LNK2, "XCOR:AS01:221:IDIFF") field(LNK3, "XCOR:AS01:221:IADIFF") field(LNK4, "XCOR:AS01:221:IRATIO") field(LNK5, "XCOR:AS01:221:IDIRECT") field(LNK6, "XCOR:AS01:221:IACTPOL_CHECK") } record(calc, "XCOR:AS01:221:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "XCOR:AS01:221:IDES") field(INPB, "XCOR:AS01:221:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "6.0") field(LOPR, "-6.0") } record(calc, "XCOR:AS01:221:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "XCOR:AS01:221:IDIFF") field(PREC, "9") } record(calc, "XCOR:AS01:221:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "XCOR:AS01:221:IDIFF") field(INPB, "XCOR:AS01:221:IDES.DRVH") field(PREC, "9") } record(calcout, "XCOR:AS01:221:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "XCOR:AS01:221:IMIN") field(INPB, "XCOR:AS01:221: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, "XCOR:AS01:221: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, "XCOR:AS01:221:IACT") field(FLNK, "XCOR:AS01:221:IACTPOL") } record(bo, "XCOR:AS01:221:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "XCOR:AS01:221: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,"XCOR:AS01:221:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from XCOR:AS01:221:IDELTAS and the\n XCOR:AS01:221: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,"XCOR:AS01:221:IACT: \n Get copy of XCOR:AS01:221:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"XCOR:AS01:221: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,"XCOR:AS01:221:IDES:\n Contains raw value calculated by \nXCOR:AS01:221: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 \nXCOR:AS01:221:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"XCOR:AS01:221: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 XCOR:AS01:221: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 XCOR:AS01:221: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,"XCOR:AS01:221:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by XCOR:AS01:221:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, XCOR:AS01:221:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n XCOR:AS01:221: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, "XCOR:AS01:221:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "XCOR:AS01:221:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "XCOR:AS01:221:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "XCOR:AS01:221:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "XCOR:AS01:221:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "XCOR:AS01:221:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "0") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "XCOR:AS01:221: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, "XCOR:AS01:221:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "XCOR:AS01:221:TRIMTYPE.RVAL") field(INPB, "XCOR:AS01:221:CONFIG.RVAL") field(OUT, "XCOR:AS01:221:TRIMMAXNUM PP") } record(longout, "XCOR:AS01:221: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, "XCOR:AS01:221: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, "closed_loop") field(VAL, "1") field(OUT, "XCOR:AS01:221:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "XCOR:AS01:221: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, "closed_loop") field(VAL, "10") } record(bo, "XCOR:AS01:221: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, "XCOR:AS01:221: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, "XCOR:AS01:221:TRIMSTEPMIN") { field(DESC, "Min step in current") field(DTYP, "Soft Channel") field(DOL, "MCOR:AS01:107:ISTEP") field(PREC, "7") field(EGUF, "10") field(EGUL, "0") field(EGU, "A") field(HOPR, "10") field(LOPR, "0") field(VAL, "0.0001") } record(bo, "XCOR:AS01:221:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "1") } record(ao, "XCOR:AS01:221: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, "XCOR:AS01:221:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "XCOR:AS01:221: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, "XCOR:AS01:221: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, "XCOR:AS01:221:IMOVE") field(INPB, "XCOR:AS01:221:IACT") field(INPC, "XCOR:AS01:221:IRAMPRATE") field(INPD, "1.0") field(INPE, "XCOR:AS01:221:TRIMDLYPCT") field(INPF, "XCOR:AS01:221:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "XCOR:AS01:221:RAMPTIME_LEFT PP") } record(longout, "XCOR:AS01:221:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "XCOR:AS01:221:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "XCOR:AS01:221:RAMPDONE_CALC") } record(calc, "XCOR:AS01:221:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "XCOR:AS01:221:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "XCOR:AS01:221:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "XCOR:AS01:221: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, "XCOR:AS01:221:RAMPTIME_LEFT") field(OUT, "XCOR:AS01:221:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "XCOR:AS01:221:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "XCOR:AS01:221:RAMPTIME_LEFT NMS") field(OUT, "XCOR:AS01:221:RAMPDONE PP") } record(bo, "XCOR:AS01:221:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "XCOR:AS01:221:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "XCOR:AS01:221: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, "XCOR:AS01:221: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, "XCOR:AS01:221:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "XCOR:AS01:221:DEBUG.PROC PP") field(LNK2, "XCOR:AS01:221:STDZCYCLENUM.PROC PP") field(LNK3, "XCOR:AS01:221:STDZDISABLE.PROC PP") field(LNK4, "XCOR:AS01:221: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, "XCOR:AS01:221:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "XCOR:AS01:221:STDZIMIN NPP NMS") field(INPB, "XCOR:AS01:221:STDZIMAX NPP NMS") field(INPC, "XCOR:AS01:221:STDZIFINAL NPP NMS") field(INPD, "XCOR:AS01:221:STDZCYCLENUM NPP NMS") field(INPE, "XCOR:AS01:221:STDZDIRECT.RVAL NPP NMS") field(INPF, "XCOR:AS01:221:STDZDISABLE.RVAL CPP NMS") field(INPG, "XCOR:AS01:221: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, "XCOR:AS01:221:STDZWF PP") field(OUTB, "XCOR:AS01:221: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, "XCOR:AS01:221:STDZWF") } record(mbbo, "XCOR:AS01:221: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, "XCOR:AS01:221: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, "XCOR:AS01:221:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "XCOR:AS01:221: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, "XCOR:AS01:221: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, "XCOR:AS01:221: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, "XCOR:AS01:221:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "XCOR:AS01:221:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "XCOR:AS01:221:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "XCOR:AS01:221: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, "XCOR:AS01:221:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "XCOR:AS01:221:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "XCOR:AS01:221:STDZIMIN") } record(ao, "XCOR:AS01:221:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(VAL, "-6.0") field(FLNK, "XCOR:AS01:221:STDZIMAX") } record(ao, "XCOR:AS01:221:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(VAL, "6.0") field(FLNK, "XCOR:AS01:221:STDZIFINAL") } record(ao, "XCOR:AS01:221:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(VAL, "-6.0") field(FLNK, "XCOR:AS01:221: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, "XCOR:AS01:221: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, "XCOR:AS01:221:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "XCOR:AS01:221:STDZIMIN CP NMS") field(INPB, "XCOR:AS01:221:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "XCOR:AS01:221:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "XCOR:AS01:221:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "XCOR:AS01:221:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "XCOR:AS01:221:STDZIMIN CP NMS") field(INPB, "XCOR:AS01:221:STDZIMAX CP NMS") field(INPC, "XCOR:AS01:221:TRIMRAMPRATE CP NMS") field(INPD, "1.0") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "XCOR:AS01:221:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "XCOR:AS01:221:TRIMDLYPCT CP MS") field(INPB, "XCOR:AS01:221: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, "XCOR:AS01:221:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "XCOR:AS01:221: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, "XCOR:AS01:221:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "XCOR:AS01:221:IDES.HOPR") field(INPB, "XCOR:AS01:221:STDZMINIPCT CPP NMS") field(INPC, "XCOR:AS01:221:IDES.LOPR") field(PREC, "5") } record(calc, "XCOR:AS01:221:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "XCOR:AS01:221:IDES.HOPR") field(INPB, "XCOR:AS01:221:IDES.LOPR") field(INPC, "XCOR:AS01:221:STDZDIRECT.RVAL") field(INPD, "XCOR:AS01:221:STDZMINIDELTA") field(INPE, "XCOR:AS01:221:IDES") field(PREC, "5") field(FLNK, "XCOR:AS01:221: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, "XCOR:AS01:221:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "XCOR:AS01:221:IDES.HOPR") field(INPB, "XCOR:AS01:221:IDES.LOPR") field(INPC, "XCOR:AS01:221:STDZDIRECT.RVAL") field(INPD, "XCOR:AS01:221:STDZMINIDELTA") field(INPE, "XCOR:AS01:221: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, "XCOR:AS01:221: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, "XCOR:AS01:221:IADJUST.RVAL") field(INPB, "XCOR:AS01:221:STDZDIRECT.RVAL") field(INPC, "XCOR:AS01:221:STDZOK.RVAL") field(INPD, "XCOR:AS01:221:STDZDISABLE.RVAL") field(INPE, "XCOR:AS01:221:STATE.RVAL CPP NMS") field(INPF, "XCOR:AS01:221:ICTRL.RVAL") field(INPG, "XCOR:AS01:221:STATE.SEVR") field(INPH, "XCOR:AS01:221:BDELTAS.M") field(INPI, "XCOR:AS01:221:IACT.SEVR") field(OUT, "XCOR:AS01:221:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "XCOR:AS01:221:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "XCOR:AS01:221:STDZLOSTTOD.PROC") field(LNK2, "XCOR:AS01:221:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "XCOR:AS01:221:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "XCOR:AS01:221:CHECKPWRDIP_ENABLE") field(INPA, "XCOR:AS01:221:IACT CP") field(INPB, "XCOR:AS01:221:STDZIACTMAX") field(EGU, "A") field(FLNK, "XCOR:AS01:221: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, "XCOR:AS01:221:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "XCOR:AS01:221:CHECKPWRDIP_ENABLE") field(INPA, "XCOR:AS01:221:STDZIACTMAX") field(INPB, "XCOR:AS01:221:IACT") field(INPC, "XCOR:AS01:221:IDELTAS.I") field(OUT, "XCOR:AS01:221: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, "XCOR:AS01:221:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "XCOR:AS01:221:STDZOK.RVAL CP") field(INPB, "XCOR:AS01:221:STDZDISABLE.RVAL CP") field(INPC, "XCOR:AS01:221: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, "XCOR:AS01:221: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, "XCOR:AS01:221:CALBOK") { field(DESC, "Successful Calibration") field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "") 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, "XCOR:AS01:221:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "XCOR:AS01:221:CALBOK") field(INPB, "XCOR:AS01:221:CALBDISABLE") field(INPC, "XCOR:AS01:221:CALBSLOPE") field(OOPT, "On Change") field(OUT, "XCOR:AS01:221: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, "XCOR:AS01:221:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "XCOR:AS01:221: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, "XCOR:AS01:221:CALBSLOPE") field(DOL3, "XCOR:AS01:221:CALBOFFSET") field(DOL4, "0") field(DOL5, "0") field(LNK1, "MCOR:AS01:107:VSETPT.DISA PP NMS") field(LNK2, "MCOR:AS01:107:VSETPT.ASLO PP NMS") field(LNK3, "MCOR:AS01:107:VSETPT.AOFF PP NMS") field(LNK4, "MCOR:AS01:107:VSETPT.LINR PP NMS") field(LNK5, "MCOR:AS01:107:VSETPT.DISA PP NMS") # # 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, "MCOR:AS01:107:VSETPT.DISA PP NMS") field(LNK7, "MCOR:AS01:107:VSETPT.ASLO PP NMS") field(LNK8, "MCOR:AS01:107:VSETPT.AOFF PP NMS") field(LNK9, "MCOR:AS01:107:VSETPT.LINR PP NMS") field(LNKA, "MCOR:AS01:107:VSETPT.DISA PP NMS") } record(stringout, "XCOR:AS01:221:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "XCOR:AS01:221: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, "XCOR:AS01:221: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, "XCOR:AS01:221: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, "XCOR:AS01:221:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "XCOR:AS01:221: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, "XCOR:AS01:221:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "MCOR:AS01:107:VSETPT.ESLO") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "XCOR:AS01:221:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "XCOR:AS01:221:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "MCOR:AS01:107:VSETPT.EOFF") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "XCOR:AS01:221: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, "XCOR:AS01:221:CALCDAC") { field(DESC, "IACT to DAC Counts") field(CALC, "D=0?0:(((C*A)+B)-E)/D") field(INPA, "MCOR:AS01:107:I2VSLOPE") field(INPB, "0.0") field(INPC, "XCOR:AS01:221:IACT") field(INPD, "XCOR:AS01:221:DACSLOPE") field(INPE, "XCOR:AS01:221:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "XCOR:AS01:221:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "MCOR:AS01:107:VSETPT.RVAL CP") field(OMSL, "closed_loop") field(PREC, "6") field(PINI, "YES") } record(ao, "XCOR:AS01:221:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "6.0") field(HOPR, "6.0") field(DRVL, "-6.0") field(LOPR, "-6.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "XCOR:AS01:221:CALBIMAX") } record(ao, "XCOR:AS01:221:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "6.0") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVL, "-6.0") field(EGU, "A") field(VAL, "6.0") field(FLNK, "XCOR:AS01:221:CALBSTEPNUM") } record(ao, "XCOR:AS01:221:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(VAL, "0") } record(longout, "XCOR:AS01:221: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, "XCOR:AS01:221:CALBIDELTA") } record(calc, "XCOR:AS01:221:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "XCOR:AS01:221:CALBIMAX") field(INPB, "XCOR:AS01:221:CALBIMIN") field(INPC, "XCOR:AS01:221: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, "XCOR:AS01:221:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "MCOR:AS01:107:ISETPT.DRVH") field(INPB, "MCOR:AS01:107:IACT.HOPR") field(INPC, "XCOR:AS01:221:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "XCOR:AS01:221:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "XCOR:AS01:221:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "XCOR:AS01:221:DACSA") } # Used only for xygraph edm plot record(subArray, "XCOR:AS01:221:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "XCOR:AS01:221: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, "XCOR:AS01:221:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "XCOR:AS01:221:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "XCOR:AS01:221:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "XCOR:AS01:221: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, "XCOR:AS01:221:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "XCOR:AS01:221:CALBYSA") } # Used only for xygraph edm plot record(subArray, "XCOR:AS01:221:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "XCOR:AS01:221:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "XCOR:AS01:221:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "XCOR:AS01:221:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "XCOR:AS01:221:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "XCOR:AS01:221:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "XCOR:AS01:221:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "XCOR:AS01:221: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, "XCOR:AS01:221:CALBSTEPNUM") field(INPB, "XCOR:AS01:221:CALBIACTWF") field(INPC, "XCOR:AS01:221: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, "XCOR:AS01:221: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, "XCOR:AS01:221:STDZITOL") field(INPH, "XCOR:AS01:221:DACSLOPE") field(INPI, "XCOR:AS01:221: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, "XCOR:AS01:221: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, "XCOR:AS01:221:CALBSTEPNUM") field(INPB, "XCOR:AS01:221:CALBIACTWF") field(INPC, "XCOR:AS01:221:DACWF") field(INPF, "XCOR:AS01:221: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 XCOR:AS01:221CALBOK 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, "XCOR:AS01:221:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "XCOR:AS01:221:DEGAUSIMIN.PROC PP") field(OUTB, "XCOR:AS01:221:DEGAUSIMAX.PROC PP") field(OUTC, "XCOR:AS01:221:DEGAUSTYPE.PROC PP") field(OUTD, "XCOR:AS01:221:DEGAUSSTEP.PROC PP") field(OUTE, "XCOR:AS01:221:MADNAME.PROC PP") field(OUTF, "XCOR:AS01:221:PSTYPE.PROC PP") field(OUTG, "XCOR:AS01:221: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, "XCOR:AS01:221:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "XCOR:AS01:221:DEGAUSIMIN NPP NMS") field(INPB, "XCOR:AS01:221:DEGAUSIMAX NPP NMS") field(INPC, "XCOR:AS01:221:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "XCOR:AS01:221:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "XCOR:AS01:221:PSTYPE NPP NMS") field(INPG, "XCOR:AS01:221:DEBUG.RVAL NPP NMS") field(INPH, "XCOR:AS01:221: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, "XCOR:AS01:221:DEGAUSWF PP") field(OUTB, "XCOR:AS01:221:DEGAUSMSG PP") field(OUTC, "XCOR:AS01:221: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, "XCOR:AS01:221:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"XCOR:AS01:221: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, "XCOR:AS01:221: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, "XCOR:AS01:221: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, "XCOR:AS01:221: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, "XCOR:AS01:221: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, "XCOR:AS01:221:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(VAL, "-6.0") } record(ao, "XCOR:AS01:221:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(VAL, "6.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,"XCOR:AS01:221: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, "XCOR:AS01:221: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,"XCOR:AS01:221: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, "XCOR:AS01:221: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, "XCOR:AS01:221: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, "XCOR:AS01:221: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, "XCOR:AS01:221:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "XCOR:AS01:221:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "XCOR:AS01:221:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "XCOR:AS01:221:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "XCOR:AS01:221: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, "XCOR:AS01:221:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "XCOR:AS01:221: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, "XCOR:AS01:221:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "XCOR:AS01:221:DEGAUS_IMAX") field(INPB, "XCOR:AS01:221:ISETPT") field(INPC, "XCOR:AS01:221:DEGAUSTYPE.RVAL") field(OUT, "XCOR:AS01:221:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "XCOR:AS01:221:DEGAUS_IMAX_UPDATE") } record(seq, "XCOR:AS01:221:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "XCOR:AS01:221:ISETPT") field(LNK1, "XCOR:AS01:221:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "XCOR:AS01:221:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(VAL, "6.0") field(FLNK, "XCOR:AS01:221:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "XCOR:AS01:221:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "XCOR:AS01:221:DEGAUS_IMAX") field(FLNK, "XCOR:AS01:221:DEGAUS_IMAXPOL") } record(bo, "XCOR:AS01:221:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "XCOR:AS01:221:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "XCOR:AS01:221: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, "XCOR:AS01:221:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "XCOR:AS01:221:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "6.0") field(LOPR, "-6.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "XCOR:AS01:221:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "XCOR:AS01:221:IACT") field(INPB, "XCOR:AS01:221:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "XCOR:AS01:221:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "XCOR:AS01:221:IACTPOL") } record(bo, "XCOR:AS01:221: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,"XCOR:AS01:221: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, "XCOR:AS01:221:DEGAUSENABLE CP") field(INPB, "XCOR:AS01:221:DEGAUSOK") field(INPC, "XCOR:AS01:221:STATE CP") field(INPD, "XCOR:AS01:221:STATE.SEVR") field(OUT, "XCOR:AS01:221:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "XCOR:AS01:221:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "XCOR:AS01:221:DEGAUS_STATE_CHECK") field(LNK1, "XCOR:AS01:221:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "XCOR:AS01:221:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "XCOR:AS01:221:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "XCOR:AS01:221: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, "XCOR:AS01:221:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "XCOR:AS01:221:DEGAUSOK.ZSV") field(LNK2, "XCOR:AS01:221: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, "XCOR:AS01:221:STATMSG.FRSV") field(LNK4, "XCOR:AS01:221: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, "XCOR:AS01:221:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "XCOR:AS01:221:DEGAUSOK.ZSV") field(LNK2, "XCOR:AS01:221: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, "XCOR:AS01:221:STATMSG.FRSV") field(LNK4, "XCOR:AS01:221: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, "XCOR:AS01:221:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "XCOR:AS01:221: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, "XCOR:AS01:221:STATMSG.FRSV") field(LNK3, "XCOR:AS01:221: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, "XCOR:AS01:221:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "XCOR:AS01:221: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, "XCOR:AS01:221:STATMSG.FRSV PP") field(LNK3, "XCOR:AS01:221:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "XCOR:AS01:221:FUNC") { field(DESC, "XCOR:AS01:221 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, "0") field(NIVL, "0") field(TEVL, "0") field(ELVL, "5") field(TVVL, "6") field(TTVL, "7") field(FTVL, "4") field(FFVL, "3") field(OUT, "XCOR:AS01:221:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "XCOR:AS01:221:CTRL") { field(DESC, "XCOR:AS01:221 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, "") field(TVST, "") field(TTST, "") 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, "0") field(TVVL, "0") field(TTVL, "0") field(FTVL, "0") field(FFVL, "0") field(OUT, "XCOR:AS01:221:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "XCOR:AS01:221:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "XCOR:AS01:221:BUSY") } # Set to FREE on IOC reboot record(bo, "XCOR:AS01:221:BUSY") { field(DESC, "XCOR:AS01:221 Ctrl Done") field(DOL, "XCOR:AS01:221:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "XCOR:AS01:221:SELECT") } record(bo, "XCOR:AS01:221:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "XCOR:AS01:221: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, "XCOR:AS01:221:CTRLSTATE") { field(DESC, "XCOR:AS01:221 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("XCOR:AS01:221:CTRL",20,20,0,0,"XCOR:AS01:221:CTRL") #! Field("XCOR:AS01:221:CTRL.OUT",16777215,1,"XCOR:AS01:221:CTRL.OUT") #! Link("XCOR:AS01:221:CTRL.OUT","XCOR:AS01:221:SELECTEN.A") #! Field("XCOR:AS01:221:CTRL.VAL",16777215,1,"XCOR:AS01:221:CTRL.VAL") #! Record("XCOR:AS01:221:SELECTEN",321,381,0,0,"XCOR:AS01:221:SELECTEN") #! Field("XCOR:AS01:221:SELECTEN.A",16777215,0,"XCOR:AS01:221:SELECTEN.A") #! Field("XCOR:AS01:221:SELECTEN.FLNK",16777215,1,"XCOR:AS01:221:SELECTEN.FLNK") #! Link("XCOR:AS01:221:SELECTEN.FLNK","XCOR:AS01:221:BUSY") #! Field("XCOR:AS01:221:SELECTEN.VAL",16777215,1,"XCOR:AS01:221:SELECTEN.VAL") #! Record("XCOR:AS01:221:BUSY",623,274,0,0,"XCOR:AS01:221:BUSY") #! Field("XCOR:AS01:221:BUSY.DOL",16777215,0,"XCOR:AS01:221:BUSY.DOL") #! Link("XCOR:AS01:221:BUSY.DOL","XCOR:AS01:221:SELECTEN.VAL") #! Field("XCOR:AS01:221:BUSY.FLNK",16777215,1,"XCOR:AS01:221:BUSY.FLNK") #! Link("XCOR:AS01:221:BUSY.FLNK","XCOR:AS01:221:SELECT") #! Record("XCOR:AS01:221:SELECT",669,508,0,1,"XCOR:AS01:221:SELECT") #! Record("XCOR:AS01:221:FUNC",940,120,0,0,"XCOR:AS01:221:FUNC") #! Field("XCOR:AS01:221:FUNC.OUT",16777215,0,"XCOR:AS01:221:FUNC.OUT") #! Link("XCOR:AS01:221:FUNC.OUT","XCOR:AS01:221:CTRL.VAL") #! Record("XCOR:AS01:221:ABORT",193,41,0,0,"XCOR:AS01:221:ABORT") #! Record("XCOR:AS01:221:CTRLSTATE",369,34,0,0,"XCOR:AS01:221: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,"XCOR:AS01:221:SELECT is used for Multi-device selection.\nIt is enabled when associated XCOR:AS01:221:CTRL is \"0\" (DONE).\nIt is disabled when associated XCOR:AS01:221: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,"XCOR:AS01:221: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, "XCOR:AS01:221:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "XCOR:AS01:221:BCTRL.SEVR") field(OUT, "XCOR:AS01:221: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, "XCOR:AS01:221:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "XCOR:AS01:221:BACT") field(INPB, "XCOR:AS01:221:POLYCOEF") field(INPC, "XCOR:AS01:221:POLYCOEF.A") field(INPD, "XCOR:AS01:221:POLYCOEF.B") field(INPE, "XCOR:AS01:221:IACT MS") field(INPF, "XCOR:AS01:221:BDELTAS PP") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "107.5") field(LOPR, "-107.5") field(HIHI, "107.5") field(LOLO, "-107.5") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "107.5") field(LOW, "-107.5") field(FLNK, "XCOR:AS01:221: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, "XCOR:AS01:221: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, "XCOR:AS01:221:BDES") field(INPB, "XCOR:AS01:221:TRIMBTOL") field(INPC, "XCOR:AS01:221:TRIMBTOLR") field(INPD, "XCOR:AS01:221:CHCKBTOL") field(INPE, "XCOR:AS01:221:CHCKBTOLR") field(F, "0.0") field(INPG, "30") field(INPH, "XCOR:AS01:221:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "XCOR:AS01:221:MPSBTOL") field(INPQ, "XCOR:AS01:221:MPSBTOLR") field(FLNK, "XCOR:AS01:221:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "XCOR:AS01:221:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "XCOR:AS01:221:BDES") field(INPB, "XCOR:AS01:221:BDELTAS.I") field(INPG, "XCOR:AS01:221:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "XCOR:AS01:221:BCON.HIGH") field(OUTB, "XCOR:AS01:221:BCON.LOW") field(OUTC, "XCOR:AS01:221:BCON.HIHI") field(OUTD, "XCOR:AS01:221:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "XCOR:AS01:221:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "XCOR:AS01:221:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "XCOR:AS01:221:BDIFF") field(LNK2, "XCOR:AS01:221:BADIFF") field(LNK3, "XCOR:AS01:221:BRATIO") field(LNK4, "XCOR:AS01:221:MPSLIMITS") field(LNK5, "XCOR:AS01:221:I2BSTATUS") field(LNK6, "XCOR:AS01:221:IACTFO.PROC") } record(calc, "XCOR:AS01:221:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "XCOR:AS01:221:BDES") field(INPB, "XCOR:AS01:221:BACT") field(EGU, "kG-m") field(PREC, "7") } record(calc, "XCOR:AS01:221:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "XCOR:AS01:221:BDIFF") field(EGU, "kG-m") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "XCOR:AS01:221:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "XCOR:AS01:221:BDIFF") field(INPB, "XCOR:AS01:221:BDES.HOPR") field(EGU, "kG-m") field(PREC, "7") } record(mbbi, "XCOR:AS01:221: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, "XCOR:AS01:221:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "XCOR:AS01:221:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "XCOR:AS01:221:BMON") field(INPB, "XCOR:AS01:221:POLYCOEF") field(INPC, "XCOR:AS01:221:POLYCOEF.A") field(INPD, "XCOR:AS01:221:POLYCOEF.B") field(INPE, "XCOR:AS01:221:IMON MS") field(INPF, "XCOR:AS01:221:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "107.5") field(LOPR, "-107.5") field(HIHI, "107.5") field(LOLO, "-107.5") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "107.5") field(LOW, "-107.5") } # 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=MCOR:AS01:107:BDES CP record(ao, "XCOR:AS01:221:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "107.5") field(DRVL, "-107.5") field(HOPR, "107.5") field(LOPR, "-107.5") field(PREC, "7") field(EGU, "kG-m") field(MDEL, "-1") field(OMSL, "supervisory") # field(DOL, "") field(OUT, "XCOR:AS01:221:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "XCOR:AS01:221:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "XCOR:AS01:221:POLYCOEF") field(INPC, "XCOR:AS01:221:POLYCOEF.A") field(INPD, "XCOR:AS01:221:POLYCOEF.B") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "107.5") field(LOPR, "-107.5") field(MDEL, "-1") field(INPE, "XCOR:AS01:221:BDES.DRVH") field(INPF, "XCOR:AS01:221:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "XCOR:AS01:221:IDES") } record(sub, "XCOR:AS01:221:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "XCOR:AS01:221:POLYCOEF") field(INPC, "XCOR:AS01:221:POLYCOEF.A") field(INPD, "XCOR:AS01:221:POLYCOEF.B") field(INPE, "XCOR:AS01:221:BDES.DRVH") field(INPF, "XCOR:AS01:221:BDES.DRVL") field(EGU, "kG-m") field(HOPR, "107.5") field(LOPR, "-107.5") field(PREC, "7") field(VAL, "0.0") field(FLNK, "XCOR:AS01:221:INOM") } record(sub, "XCOR:AS01:221:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "XCOR:AS01:221:BDES.VAL") field(INPB, "XCOR:AS01:221:BDES.DRVH") field(INPC, "XCOR:AS01:221:BDES.DRVL") field(INPD, "XCOR:AS01:221:BDELTAS.I") field(INPE, "XCOR:AS01:221:BDELTAS.J") field(INPG, "XCOR:AS01:221:STATE") field(INPH, "XCOR:AS01:221:HSTA") field(EGU, "kG-m") field(HOPR, "107.5") field(LOPR, "-107.5") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "XCOR:AS01:221:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "XCOR:AS01:221:BDES.VAL") field(INPB, "XCOR:AS01:221:BDES.DRVH") field(INPC, "XCOR:AS01:221:BDES.DRVL") field(INPD, "XCOR:AS01:221:BDELTAS.K") field(INPE, "XCOR:AS01:221:BDELTAS.L") field(INPG, "XCOR:AS01:221:STATE") field(INPH, "XCOR:AS01:221:HSTA") field(EGU, "kG-m") field(HOPR, "107.5") field(LOPR, "-107.5") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "XCOR:AS01:221:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "XCOR:AS01:221:BLIMITS") field(LNK1, "XCOR:AS01:221:BACTLIMITS.F PP") field(DOL2, "XCOR:AS01:221:BACTLIMITS.I") field(LNK2, "XCOR:AS01:221:BACT.HIGH") field(DOL3, "XCOR:AS01:221:BACTLIMITS.J") field(LNK3, "XCOR:AS01:221:BACT.LOW") field(DOL4, "XCOR:AS01:221:BACTLIMITS.K") field(LNK4, "XCOR:AS01:221:BACT.HIHI") field(DOL5, "XCOR:AS01:221:BACTLIMITS.L") field(LNK5, "XCOR:AS01:221:BACT.LOLO") field(DOL6, "XCOR:AS01:221:BLIMITS") field(LNK6, "XCOR:AS01:221:BMONLIMITS.F PP") field(DOL7, "XCOR:AS01:221:BMONLIMITS.I") field(LNK7, "XCOR:AS01:221:BMON.HIGH") field(DOL8, "XCOR:AS01:221:BMONLIMITS.J") field(LNK8, "XCOR:AS01:221:BMON.LOW") field(DOL9, "XCOR:AS01:221:BMONLIMITS.K") field(LNK9, "XCOR:AS01:221:BMON.HIHI") field(DOLA, "XCOR:AS01:221:BMONLIMITS.L") field(LNKA, "XCOR:AS01:221:BMON.LOLO") field(FLNK, "XCOR:AS01:221:ILIMITS") field(SCAN, "5 second") } record(ao, "XCOR:AS01:221:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG-m") field(DRVH, "107.5") field(DRVL, "-107.5") field(HOPR, "107.5") field(LOPR, "-107.5") # 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, "XCOR:AS01:221: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, "XCOR:AS01:221:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "XCOR:AS01:221:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "XCOR:AS01:221:BCTRL.VAL") field(LNK2, "XCOR:AS01:221:BDES PP") field(DOL3, "1") field(LNK3, "XCOR:AS01:221:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "XCOR:AS01:221:CHECKSTDZLOST.PROC PP") field(DOL5, "XCOR:AS01:221:BCTRL.VAL") field(LNK5, "XCOR:AS01:221:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "XCOR:AS01:221:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "XCOR:AS01:221:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "XCOR:AS01:221:POLYCOEF") field(INPC, "XCOR:AS01:221:POLYCOEF.A") field(INPD, "XCOR:AS01:221:POLYCOEF.B") field(INPE, "XCOR:AS01:221:BDES.DRVH") field(INPF, "XCOR:AS01:221:BDES.DRVL") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "107.5") field(LOPR, "-107.5") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "XCOR:AS01:221:ISETPT") } record(ao, "XCOR:AS01:221:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "107.5") field(DRVL, "-107.5") field(EGU, "kG-m") field(HOPR, "107.5") field(LOPR, "-107.5") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "XCOR:AS01:221:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "XC01S") } record(ai, "XCOR:AS01:221: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, "2018.595") } record(ao, "XCOR:AS01:221:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "107.5") field(DRVL, "-107.5") field(EGU, "kG-m") field(HOPR, "107.5") field(LOPR, "-107.5") field(PREC, "7") field(PINI, "YES") field(VAL, "107.5") field(FLNK, "XCOR:AS01:221:BSTEP") } record(ao, "XCOR:AS01:221:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "107.5") field(DRVL, "-107.5") field(EGU, "kG-m") field(HOPR, "107.5") field(LOPR, "-107.5") field(PREC, "7") field(PINI, "YES") field(VAL, "-107.5") field(FLNK, "XCOR:AS01:221:BSTEP") } record(ao, "XCOR:AS01:221:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "107.5") field(DRVL, "-107.5") field(EGU, "kG-m") field(HOPR, "107.5") field(LOPR, "-107.5") field(PINI, "YES") field(PREC, "7") } # This record is processed by XCOR:AS01:221: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, "XCOR:AS01:221:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "107.5") field(LOPR, "-107.5") field(DRVH, "107.5") field(DRVL, "-107.5") # 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, "XCOR:AS01:221:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "XCOR:AS01:221:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "XCOR:AS01:221:POLYCOEF") field(INPC, "XCOR:AS01:221:POLYCOEF.A") field(INPD, "XCOR:AS01:221:POLYCOEF.B") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "107.5") field(LOPR, "-107.5") field(MDEL, "-1") field(INPE, "XCOR:AS01:221:BCON.DRVH") field(INPF, "XCOR:AS01:221:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "XCOR:AS01:221: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, "XCOR:AS01:221:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "XCOR:AS01:221:BMAX") field(INPB, "XCOR:AS01:221:BMIN") field(INPC, "XCOR:AS01:221:BMIN.SEVR") field(INPD, "XCOR:AS01:221: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,"XCOR:AS01:221:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "XCOR:AS01:221:ONLINE CP") field(OUT, "XCOR:AS01:221:BCTRLDISABLEFOUT PP") } record(fanout, "XCOR:AS01:221:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "XCOR:AS01:221:BCTRLDISABLECALC") field(LNK1, "XCOR:AS01:221:BCTRLDISABLE") field(LNK2, "XCOR:AS01:221:BCTRLENABLE") } record(stringout, "XCOR:AS01:221:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "XCOR:AS01:221:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "XCOR:AS01:221:BCTRLDISV_UPDATE") } record(stringout, "XCOR:AS01:221:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "XCOR:AS01:221:BCTRL.ASG") field(VAL, "") field(FLNK, "XCOR:AS01:221:BCTRLDISV_UPDATE") } record(calcout, "XCOR:AS01:221:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "XCOR:AS01:221:ONLINE") field(OUT, "XCOR:AS01:221: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,"XCOR:AS01:221:BACT and MON\n are processed via links from \n XCOR:AS01:221:IACT (device raw value readback 1)\n and\n XCOR:AS01:221: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 XCOR:AS01:221:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = XCOR:AS01:221: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,"XCOR:AS01:221:BDES\n is processed when set by CA users or \n XCOR:AS01:221: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,"XCOR:AS01:221: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 XCOR:AS01:221: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 (XCOR:AS01:221: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,"XCOR:AS01:221:B*LIMITS and XCOR:AS01:221:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from XCOR:AS01:221: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,"XCOR:AS01:221: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,"XCOR:AS01:221: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, "XCOR:AS01:221: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, "XCOR:AS01:221:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG-m") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "XCOR:AS01:221:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "XCOR:AS01:221:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "107.5") field(DRVL, "-107.5") field(PINI, "YES") field(VAL, "107.5") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "XCOR:AS01:221:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "107.5") field(DRVL, "-107.5") field(PINI, "YES") field(VAL, "-107.5") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "XCOR:AS01:221:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "107.5") field(DRVL, "-107.5") field(PINI, "YES") field(VAL, "-107.5") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "XCOR:AS01:221:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "107.5") field(DRVL, "-107.5") field(PINI, "YES") field(VAL, "-107.5") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "XCOR:AS01:221: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, "XCOR:AS01:221:MPSLIMITS.E PP") } record(aSub, "XCOR:AS01:221: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, "XCOR:AS01:221:MPS.RVAL") field(INPB, "XCOR:AS01:221:BADIFF") field(INPC, "XCOR:AS01:221:BDELTAS.N") field(INPD, "XCOR:AS01:221:BACT") field(INPE, "XCOR:AS01:221:MPSBITMASK.RVAL") field(INPF, "XCOR:AS01:221:MPSBLLIM") field(INPG, "XCOR:AS01:221:MPSBMIN") field(INPH, "XCOR:AS01:221:MPSBMAX") field(INPI, "XCOR:AS01:221: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, "XCOR:AS01:221:INTOL.RVAL PP") field(OUTB, "XCOR:AS01:221:INTOL_BMIN.RVAL PP") field(OUTC, "XCOR:AS01:221:INTOL_BRANGE.RVAL PP") field(OUTD, "XCOR:AS01:221: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, "XCOR:AS01:221:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "XCOR:AS01:221:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "XCOR:AS01:221:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "XCOR:AS01:221:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "XCOR:AS01:221:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "XCOR:AS01:221:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "XCOR:AS01:221:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "XCOR:AS01:221: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, "XCOR:AS01:221:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "XCOR:AS01:221:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "XCOR:AS01:221:CHCKBTOL") field(INPB, "XCOR:AS01:221:POLYCOEF.B") field(PREC, "9") } record(calc, "XCOR:AS01:221: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, "XCOR:AS01:221:CHCKBTOL") field(FLNK, "XCOR:AS01:221:CHCKITOL") } record(calc, "XCOR:AS01:221:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "XCOR:AS01:221:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "XCOR:AS01:221:BDES.HOPR") field(INPB, "XCOR:AS01:221:STABILITY") field(INPC, "XCOR:AS01:221:BDES.LOPR") } record(longout, "XCOR:AS01:221:STABILITY") { field(DESC, "Long Term Stability") field(PINI, "YES") field(VAL, "1000") field(EGU, "ppm") field(DRVH, "3000") field(DRVL, "100") field(HOPR, "3000") field(LOPR, "100") field(FLNK, "XCOR:AS01:221:CHCKBTOL") } record(calc, "XCOR:AS01:221:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG-m") field(CALC, "ABS(A*B)") field(INPA, "XCOR:AS01:221:POLYCOEF.B") field(INPB, "XCOR:AS01:221:TRIMBTOL") field(PREC, "9") } record(ai, "XCOR:AS01:221:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "XCOR:AS01:221: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, "XCOR:AS01:221:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "XCOR:AS01:221:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "XCOR:AS01:221:PAUGO") } record(fanout, "XCOR:AS01:221:PAUGO") { field(DESC, "PAU control") field(LNK1, "XCOR:AS01:221:PAUSTOP") field(LNK2, "XCOR:AS01:221: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, "XCOR:AS01:221:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "XCOR:AS01:221:PAU.RVAL") field(DISV, "0") field(DOL1, "0") field(DOL2, "0") field(DOL3, "1") field(DLY3, "1") # field(LNK1, "MCOR:AS01:107:ISETPT.DISV") # field(LNK2, "MCOR:AS01:107:VSETPT.DISV") # field(LNK3, "ACTPAU PP") } record(seq, "XCOR:AS01:221:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "XCOR:AS01:221:PAU.RVAL") field(DISV, "1") field(DOL1, "1") field(DOL2, "1") field(DOL3, "0") # field(LNK1, "MCOR:AS01:107:ISETPT.DISV") # field(LNK2, "MCOR:AS01:107:VSETPT.DISV") # field(LNK3, "ACTPAU PP") } # Change attribute to PSDEVNAME record(stringout, "XCOR:AS01:221:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "MCOR:AS01:107:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "XCOR:AS01:221: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, "XCOR:AS01:221:PSTYPE.RVAL") field(INPC, "XCOR:AS01:221:TURNEDOFF.RVAL") field(INPD, "XCOR:AS01:221:CONFIG.RVAL") field(INPE, "XCOR:AS01:221:PSCATEGORY.RVAL") field(INPF, "XCOR:AS01:221:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "XCOR:AS01:221:AUTOCTRL.RVAL") field(INPJ, "XCOR:AS01:221:OUTOFSERVICE.RVAL") field(INPL, "XCOR:AS01:221:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "XCOR:AS01:221:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "XCOR:AS01:221:PAU") field(INPP, "XCOR:AS01:221:CALBDISABLE.RVAL") field(INPQ, "XCOR:AS01:221:PTRBDISABLE.RVAL") field(INPR, "XCOR:AS01:221:TRIMDISABLE.RVAL") field(INPS, "XCOR:AS01:221:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "XCOR:AS01:221:FBCK") field(INPU, "XCOR:AS01:221:TRIMTYPE.RVAL") field(INPV, "XCOR:AS01:221:STDZDIRECT.RVAL") field(INPW, "XCOR:AS01:221:DEGAUSENABLE.RVAL") field(FLNK, "XCOR:AS01:221:HSTA") } record(longin, "XCOR:AS01:221:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "XCOR:AS01:221:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "XCOR:AS01:221: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, "XCOR:AS01:221: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, "XCOR:AS01:221: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, "XCOR:AS01:221: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, "XCOR:AS01:221: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, "XCOR:AS01:221: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 XCOR:AS01:221:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses XCOR:AS01:221:FBCK. # This PV should be replaced by XCOR:AS01:221: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, "XCOR:AS01:221: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, "XCOR:AS01:221: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, "XCOR:AS01:221: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, "XCOR:AS01:221:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"XCOR:AS01:221:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "XCOR:AS01:221:OUTOFSERVICE NPP NMS") field(OUT, "XCOR:AS01:221:ONLINE PP") } record(bo, "XCOR:AS01:221:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "XCOR:AS01:221: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, "XCOR:AS01:221: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, "XCOR:AS01:221: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, "XCOR:AS01:221: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, "XCOR:AS01:221: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, "XCOR:AS01:221: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, "XCOR:AS01:221: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, "XCOR:AS01:221: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, "XCOR:AS01:221: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, "0") field(ASG, "NOWRITE") } record(mbbo, "XCOR:AS01:221: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, "0") field(ASG, "NOWRITE") } record(mbbo, "XCOR:AS01:221: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, "XCOR:AS01:221:TRIMTYPE") } record(stringout, "XCOR:AS01:221:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "XCOR:AS01:221:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "XCOR:AS01:221:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "XCOR:AS01:221:STATE.RVAL") field(INPB, "XCOR:AS01:221:INTLKSUMY.RVAL") field(OUT, "XCOR:AS01:221:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "XCOR:AS01:221: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, "XCOR:AS01:221:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "XCOR:AS01:221:STATE.RVAL") field(INPB, "XCOR:AS01:221:INTLKSUMY.RVAL") field(OUT, "XCOR:AS01:221:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "XCOR:AS01:221:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "XCOR:AS01:221:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "XCOR:AS01:221: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, "XCOR:AS01:221: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, "XCOR:AS01:221: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, "XCOR:AS01:221: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,"XCOR:AS01:221: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("XCOR:AS01:221:TURNEDOFF",3140,1907,0,1,"XCOR:AS01:221:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "XCOR:AS01:221:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "XCOR:AS01:221:BACT.STAT") field(INPB, "XCOR:AS01:221:BDES.STAT") field(INPC, "XCOR:AS01:221:IRIPL.STAT") field(INPD, "MCOR:AS01:107:VSETPT.STAT") field(INPE, "MCOR:AS01:107:VACT.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, "XCOR:AS01:221:BACT.SEVR") field(INPH, "XCOR:AS01:221:BDES.SEVR") field(INPI, "XCOR:AS01:221:IRIPL.SEVR") field(INPJ, "MCOR:AS01:107:VSETPT.SEVR") field(INPK, "MCOR:AS01:107:VACT.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, "XCOR:AS01:221:STATE.RVAL") field(INPN, "XCOR:AS01:221:STDZOK") field(INPO, "XCOR:AS01:221:CALBOK") field(INPP, "XCOR:AS01:221:OUTOFSERVICE.RVAL") field(INPQ, "XCOR:AS01:221:CONFIG.RVAL") field(INPR, "XCOR:AS01:221:HSTA") field(INPS, "XCOR:AS01:221:CTRL.RVAL") field(INPT, "XCOR:AS01:221:DEGAUSOK") field(INPV, "XCOR:AS01:221: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, "XCOR:AS01:221:STAT") } record(longout, "XCOR:AS01:221:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "XCOR:AS01:221:STATCTRLSUB") field(DOL, "XCOR:AS01:221:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "XCOR:AS01:221:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "XCOR:AS01:221:STAT") field(INPB, "XCOR:AS01:221:HSTA") field(INPD, "XCOR:AS01:221:ONOFFCTRL.RVAL") field(FLNK, "XCOR:AS01:221:STATMSG") } record(mbbo, "XCOR:AS01:221: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, "XCOR:AS01:221:UNAVAILGO") field(DOL, "XCOR:AS01:221:STATCTRLSUB.W") } record(seq, "XCOR:AS01:221:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "XCOR:AS01:221:STATSUB.U") field(LNK1, "XCOR:AS01:221:UNAVAIL PP") } record(stringout, "XCOR:AS01:221:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"XCOR:AS01:221:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - XCOR:AS01:221:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - XCOR:AS01:221: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,"XCOR:AS01:221STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - XCOR:AS01:221:STATUS\nC - XCOR:AS01:221:ON\nD - XCOR:AS01:221:STDZOK\nE - XCOR:AS01:221:CALBOK\nF - XCOR:AS01:221:BACTDRIFT (future)\nG -\nH- XCOR:AS01:221:DACSTATUS\nI -XCOR:AS01:221:ADCSTATUS\nJ - XCOR:AS01:221:BACTSTATUS\nK - XCOR:AS01:221:BDESSTATUS\nL - XCOR:AS01:221:RIPLSTATUS\n\nOutput:\nP - XCOR:AS01:221: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, "XCOR:AS01:221: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, "XCOR:AS01:221: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, "XCOR:AS01:221: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, "XCOR:AS01:221: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 # Note: for slave with trim coils # set the macro ACT to the following: # ACT=:IACTCALC record(ai, "YCOR:AS01:222:IACT") { field(DESC, "Current") field(INP, "MCOR:AS01:108:IACT") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "YCOR:AS01:222:BACT") info(autosaveFields,"HYST") } record(bi, "YCOR:AS01:222:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "MCOR:AS01:108:STATE NPP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "YCOR:AS01:222:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "6.0") field(LOLO, "-6.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "YCOR:AS01:222:BDELTAS") field(DRVH, "6.0") field(DRVL, "-6.0") field(DOL, "YCOR:AS01:222: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, "YCOR:AS01:222:ICTRL PP") } # This record is processed by YCOR:AS01:222:ICON") # Note: we are not setting alarms here. record(ao, "YCOR:AS01:222:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(DOL, "YCOR:AS01:222:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "YCOR:AS01:222:INOM") { field(DESC, "Nominal Current") field(DOL, "YCOR:AS01:222:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "6.0") field(DRVL, "-6.0") field(HOPR, "6.0") field(LOPR, "-6.0") } record(ao, "YCOR:AS01:222:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(MDEL, "-1") field(FLNK, "YCOR:AS01:222:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "YCOR:AS01:222:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "YCOR:AS01:222:ISETPT.OMSL") field(DOL2, "YCOR:AS01:222:ICTRL") field(LNK2, "YCOR:AS01:222:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "YCOR:AS01:222:ISETPT.OMSL") } record(ao, "YCOR:AS01:222:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "6.0") field(DRVL, "-6.0") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(PINI, "YES") field(VAL, "6.0") field(FLNK, "YCOR:AS01:222:IMIN") } record(ao, "YCOR:AS01:222:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "6.0") field(DRVL, "-6.0") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(VAL, "-6.0") field(FLNK, "YCOR:AS01:222:IRANGE") } record(sel, "YCOR:AS01:222:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(NVL, "YCOR:AS01:222:BACT.SEVR") field(INPA, "YCOR:AS01:222:IACT NPP MS") field(INPB, "YCOR:AS01:222:IACTPREVOK NPP MS") field(INPC, "YCOR:AS01:222:IACTPREVOK NPP MS") field(INPD, "YCOR:AS01:222:IACTPREVOK NPP MS") } record(sub, "YCOR:AS01:222:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "YCOR:AS01:222:IDES") field(INPB, "YCOR:AS01:222:ISETPT.DRVH") field(INPC, "YCOR:AS01:222:ISETPT.DRVL") field(INPD, "YCOR:AS01:222:IDELTAS.I") field(INPE, "YCOR:AS01:222:IDELTAS.J") field(INPG, "YCOR:AS01:222:STATE") field(INPH, "YCOR:AS01:222:HSTA") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "YCOR:AS01:222:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "YCOR:AS01:222:IDES") field(INPB, "YCOR:AS01:222:ISETPT.DRVH") field(INPC, "YCOR:AS01:222:ISETPT.DRVL") field(INPD, "YCOR:AS01:222:IDELTAS.K") field(INPE, "YCOR:AS01:222:IDELTAS.L") field(INPG, "YCOR:AS01:222:STATE") field(INPH, "YCOR:AS01:222:HSTA") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "YCOR:AS01:222:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "YCOR:AS01:222:BLIMITS") field(LNK1, "YCOR:AS01:222:IACTLIMITS.F PP") field(DOL2, "YCOR:AS01:222:IACTLIMITS.I") field(LNK2, "YCOR:AS01:222:IACT.HIGH") field(DOL3, "YCOR:AS01:222:IACTLIMITS.J") field(LNK3, "YCOR:AS01:222:IACT.LOW") field(DOL4, "YCOR:AS01:222:IACTLIMITS.K") field(LNK4, "YCOR:AS01:222:IACT.HIHI") field(DOL5, "YCOR:AS01:222:IACTLIMITS.L") field(LNK5, "YCOR:AS01:222:IACT.LOLO") field(DOL6, "YCOR:AS01:222:BLIMITS") field(LNK6, "YCOR:AS01:222:IMONLIMITS.F PP") field(DOL7, "YCOR:AS01:222:IMONLIMITS.I") field(LNK7, "YCOR:AS01:222:IMON.HIGH") field(DOL8, "YCOR:AS01:222:IMONLIMITS.J") field(LNK8, "YCOR:AS01:222:IMON.LOW") field(DOL9, "YCOR:AS01:222:IMONLIMITS.K") field(LNK9, "YCOR:AS01:222:IMON.HIHI") field(DOLA, "YCOR:AS01:222:IMONLIMITS.L") field(LNKA, "YCOR:AS01:222: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, "YCOR:AS01:222:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "YCOR:AS01:222:TRIMBTOL") field(INPE, "YCOR:AS01:222:CHCKBTOL") field(INPF, "YCOR:AS01:222:BDELTAS.K") field(INPG, "YCOR:AS01:222:BDELTAS.L") field(INPH, "YCOR:AS01:222: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, "YCOR:AS01:222:STDZITOLR") field(INPC, "YCOR:AS01:222:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = MCOR:AS01:108: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, "YCOR:AS01:222: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 = MCOR:AS01:108:RESET PP # record(bo, "YCOR:AS01:222:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "MCOR:AS01:108:RESET PP") } record(bo, "YCOR:AS01:222:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "") 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, "YCOR:AS01:222: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, "YCOR:AS01:222:TRIMRAMPRATE") field(OUT, "") field(FLNK, "YCOR:AS01:222:STDZDLY") } record(ao, "YCOR:AS01:222:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(MDEL, "-1") field(OUT, "MCOR:AS01:108:ISETPT PP") field(DOL, "YCOR:AS01:222: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, "YCOR:AS01:222:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "YCOR:AS01:222:BMON") } record(ao, "YCOR:AS01:222:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "YCOR:AS01:222:IRIPLOK") } record(sub, "YCOR:AS01:222:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "YCOR:AS01:222:IRIPL.VAL") field(INPB, "YCOR:AS01:222: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, "YCOR:AS01:222: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, "YCOR:AS01:222:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") } record(bi, "YCOR:AS01:222:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "MCOR:AS01:108:INTLKSUMY NPP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "YCOR:AS01:222: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, "MCOR:AS01:108:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "YCOR:AS01:222:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "YCOR:AS01:222:IACTPREVOK") field(LNK2, "YCOR:AS01:222:IDIFF") field(LNK3, "YCOR:AS01:222:IADIFF") field(LNK4, "YCOR:AS01:222:IRATIO") field(LNK5, "YCOR:AS01:222:IDIRECT") field(LNK6, "YCOR:AS01:222:IACTPOL_CHECK") } record(calc, "YCOR:AS01:222:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "YCOR:AS01:222:IDES") field(INPB, "YCOR:AS01:222:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "6.0") field(LOPR, "-6.0") } record(calc, "YCOR:AS01:222:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "YCOR:AS01:222:IDIFF") field(PREC, "9") } record(calc, "YCOR:AS01:222:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "YCOR:AS01:222:IDIFF") field(INPB, "YCOR:AS01:222:IDES.DRVH") field(PREC, "9") } record(calcout, "YCOR:AS01:222:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "YCOR:AS01:222:IMIN") field(INPB, "YCOR:AS01:222: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, "YCOR:AS01:222: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, "YCOR:AS01:222:IACT") field(FLNK, "YCOR:AS01:222:IACTPOL") } record(bo, "YCOR:AS01:222:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "YCOR:AS01:222: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,"YCOR:AS01:222:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from YCOR:AS01:222:IDELTAS and the\n YCOR:AS01:222: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,"YCOR:AS01:222:IACT: \n Get copy of YCOR:AS01:222:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"YCOR:AS01:222: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,"YCOR:AS01:222:IDES:\n Contains raw value calculated by \nYCOR:AS01:222: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 \nYCOR:AS01:222:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"YCOR:AS01:222: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 YCOR:AS01:222: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 YCOR:AS01:222: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,"YCOR:AS01:222:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by YCOR:AS01:222:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, YCOR:AS01:222:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n YCOR:AS01:222: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, "YCOR:AS01:222:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "YCOR:AS01:222:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "YCOR:AS01:222:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "YCOR:AS01:222:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "YCOR:AS01:222:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "YCOR:AS01:222:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "0") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "YCOR:AS01:222: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, "YCOR:AS01:222:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "YCOR:AS01:222:TRIMTYPE.RVAL") field(INPB, "YCOR:AS01:222:CONFIG.RVAL") field(OUT, "YCOR:AS01:222:TRIMMAXNUM PP") } record(longout, "YCOR:AS01:222: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, "YCOR:AS01:222: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, "closed_loop") field(VAL, "1") field(OUT, "YCOR:AS01:222:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "YCOR:AS01:222: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, "closed_loop") field(VAL, "10") } record(bo, "YCOR:AS01:222: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, "YCOR:AS01:222: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, "YCOR:AS01:222:TRIMSTEPMIN") { field(DESC, "Min step in current") field(DTYP, "Soft Channel") field(DOL, "MCOR:AS01:108:ISTEP") field(PREC, "7") field(EGUF, "10") field(EGUL, "0") field(EGU, "A") field(HOPR, "10") field(LOPR, "0") field(VAL, "0.0001") } record(bo, "YCOR:AS01:222:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "1") } record(ao, "YCOR:AS01:222: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, "YCOR:AS01:222:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "YCOR:AS01:222: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, "YCOR:AS01:222: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, "YCOR:AS01:222:IMOVE") field(INPB, "YCOR:AS01:222:IACT") field(INPC, "YCOR:AS01:222:IRAMPRATE") field(INPD, "1.0") field(INPE, "YCOR:AS01:222:TRIMDLYPCT") field(INPF, "YCOR:AS01:222:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "YCOR:AS01:222:RAMPTIME_LEFT PP") } record(longout, "YCOR:AS01:222:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "YCOR:AS01:222:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "YCOR:AS01:222:RAMPDONE_CALC") } record(calc, "YCOR:AS01:222:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "YCOR:AS01:222:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "YCOR:AS01:222:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "YCOR:AS01:222: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, "YCOR:AS01:222:RAMPTIME_LEFT") field(OUT, "YCOR:AS01:222:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "YCOR:AS01:222:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "YCOR:AS01:222:RAMPTIME_LEFT NMS") field(OUT, "YCOR:AS01:222:RAMPDONE PP") } record(bo, "YCOR:AS01:222:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "YCOR:AS01:222:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "YCOR:AS01:222: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, "YCOR:AS01:222: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, "YCOR:AS01:222:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "YCOR:AS01:222:DEBUG.PROC PP") field(LNK2, "YCOR:AS01:222:STDZCYCLENUM.PROC PP") field(LNK3, "YCOR:AS01:222:STDZDISABLE.PROC PP") field(LNK4, "YCOR:AS01:222: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, "YCOR:AS01:222:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "YCOR:AS01:222:STDZIMIN NPP NMS") field(INPB, "YCOR:AS01:222:STDZIMAX NPP NMS") field(INPC, "YCOR:AS01:222:STDZIFINAL NPP NMS") field(INPD, "YCOR:AS01:222:STDZCYCLENUM NPP NMS") field(INPE, "YCOR:AS01:222:STDZDIRECT.RVAL NPP NMS") field(INPF, "YCOR:AS01:222:STDZDISABLE.RVAL CPP NMS") field(INPG, "YCOR:AS01:222: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, "YCOR:AS01:222:STDZWF PP") field(OUTB, "YCOR:AS01:222: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, "YCOR:AS01:222:STDZWF") } record(mbbo, "YCOR:AS01:222: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, "YCOR:AS01:222: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, "YCOR:AS01:222:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "YCOR:AS01:222: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, "YCOR:AS01:222: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, "YCOR:AS01:222: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, "YCOR:AS01:222:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "YCOR:AS01:222:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "YCOR:AS01:222:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "YCOR:AS01:222: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, "YCOR:AS01:222:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "YCOR:AS01:222:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "YCOR:AS01:222:STDZIMIN") } record(ao, "YCOR:AS01:222:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(VAL, "-6.0") field(FLNK, "YCOR:AS01:222:STDZIMAX") } record(ao, "YCOR:AS01:222:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(VAL, "6.0") field(FLNK, "YCOR:AS01:222:STDZIFINAL") } record(ao, "YCOR:AS01:222:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(VAL, "-6.0") field(FLNK, "YCOR:AS01:222: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, "YCOR:AS01:222: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, "YCOR:AS01:222:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "YCOR:AS01:222:STDZIMIN CP NMS") field(INPB, "YCOR:AS01:222:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "YCOR:AS01:222:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "YCOR:AS01:222:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "YCOR:AS01:222:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "YCOR:AS01:222:STDZIMIN CP NMS") field(INPB, "YCOR:AS01:222:STDZIMAX CP NMS") field(INPC, "YCOR:AS01:222:TRIMRAMPRATE CP NMS") field(INPD, "1.0") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "YCOR:AS01:222:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "YCOR:AS01:222:TRIMDLYPCT CP MS") field(INPB, "YCOR:AS01:222: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, "YCOR:AS01:222:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "YCOR:AS01:222: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, "YCOR:AS01:222:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "YCOR:AS01:222:IDES.HOPR") field(INPB, "YCOR:AS01:222:STDZMINIPCT CPP NMS") field(INPC, "YCOR:AS01:222:IDES.LOPR") field(PREC, "5") } record(calc, "YCOR:AS01:222:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "YCOR:AS01:222:IDES.HOPR") field(INPB, "YCOR:AS01:222:IDES.LOPR") field(INPC, "YCOR:AS01:222:STDZDIRECT.RVAL") field(INPD, "YCOR:AS01:222:STDZMINIDELTA") field(INPE, "YCOR:AS01:222:IDES") field(PREC, "5") field(FLNK, "YCOR:AS01:222: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, "YCOR:AS01:222:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "YCOR:AS01:222:IDES.HOPR") field(INPB, "YCOR:AS01:222:IDES.LOPR") field(INPC, "YCOR:AS01:222:STDZDIRECT.RVAL") field(INPD, "YCOR:AS01:222:STDZMINIDELTA") field(INPE, "YCOR:AS01:222: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, "YCOR:AS01:222: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, "YCOR:AS01:222:IADJUST.RVAL") field(INPB, "YCOR:AS01:222:STDZDIRECT.RVAL") field(INPC, "YCOR:AS01:222:STDZOK.RVAL") field(INPD, "YCOR:AS01:222:STDZDISABLE.RVAL") field(INPE, "YCOR:AS01:222:STATE.RVAL CPP NMS") field(INPF, "YCOR:AS01:222:ICTRL.RVAL") field(INPG, "YCOR:AS01:222:STATE.SEVR") field(INPH, "YCOR:AS01:222:BDELTAS.M") field(INPI, "YCOR:AS01:222:IACT.SEVR") field(OUT, "YCOR:AS01:222:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "YCOR:AS01:222:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "YCOR:AS01:222:STDZLOSTTOD.PROC") field(LNK2, "YCOR:AS01:222:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "YCOR:AS01:222:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "YCOR:AS01:222:CHECKPWRDIP_ENABLE") field(INPA, "YCOR:AS01:222:IACT CP") field(INPB, "YCOR:AS01:222:STDZIACTMAX") field(EGU, "A") field(FLNK, "YCOR:AS01:222: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, "YCOR:AS01:222:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "YCOR:AS01:222:CHECKPWRDIP_ENABLE") field(INPA, "YCOR:AS01:222:STDZIACTMAX") field(INPB, "YCOR:AS01:222:IACT") field(INPC, "YCOR:AS01:222:IDELTAS.I") field(OUT, "YCOR:AS01:222: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, "YCOR:AS01:222:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "YCOR:AS01:222:STDZOK.RVAL CP") field(INPB, "YCOR:AS01:222:STDZDISABLE.RVAL CP") field(INPC, "YCOR:AS01:222: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, "YCOR:AS01:222: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, "YCOR:AS01:222:CALBOK") { field(DESC, "Successful Calibration") field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "") 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, "YCOR:AS01:222:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "YCOR:AS01:222:CALBOK") field(INPB, "YCOR:AS01:222:CALBDISABLE") field(INPC, "YCOR:AS01:222:CALBSLOPE") field(OOPT, "On Change") field(OUT, "YCOR:AS01:222: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, "YCOR:AS01:222:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "YCOR:AS01:222: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, "YCOR:AS01:222:CALBSLOPE") field(DOL3, "YCOR:AS01:222:CALBOFFSET") field(DOL4, "0") field(DOL5, "0") field(LNK1, "MCOR:AS01:108:VSETPT.DISA PP NMS") field(LNK2, "MCOR:AS01:108:VSETPT.ASLO PP NMS") field(LNK3, "MCOR:AS01:108:VSETPT.AOFF PP NMS") field(LNK4, "MCOR:AS01:108:VSETPT.LINR PP NMS") field(LNK5, "MCOR:AS01:108:VSETPT.DISA PP NMS") # # 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, "MCOR:AS01:108:VSETPT.DISA PP NMS") field(LNK7, "MCOR:AS01:108:VSETPT.ASLO PP NMS") field(LNK8, "MCOR:AS01:108:VSETPT.AOFF PP NMS") field(LNK9, "MCOR:AS01:108:VSETPT.LINR PP NMS") field(LNKA, "MCOR:AS01:108:VSETPT.DISA PP NMS") } record(stringout, "YCOR:AS01:222:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "YCOR:AS01:222: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, "YCOR:AS01:222: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, "YCOR:AS01:222: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, "YCOR:AS01:222:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "YCOR:AS01:222: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, "YCOR:AS01:222:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "MCOR:AS01:108:VSETPT.ESLO") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "YCOR:AS01:222:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "YCOR:AS01:222:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "MCOR:AS01:108:VSETPT.EOFF") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "YCOR:AS01:222: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, "YCOR:AS01:222:CALCDAC") { field(DESC, "IACT to DAC Counts") field(CALC, "D=0?0:(((C*A)+B)-E)/D") field(INPA, "MCOR:AS01:108:I2VSLOPE") field(INPB, "0.0") field(INPC, "YCOR:AS01:222:IACT") field(INPD, "YCOR:AS01:222:DACSLOPE") field(INPE, "YCOR:AS01:222:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "YCOR:AS01:222:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "MCOR:AS01:108:VSETPT.RVAL CP") field(OMSL, "closed_loop") field(PREC, "6") field(PINI, "YES") } record(ao, "YCOR:AS01:222:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "6.0") field(HOPR, "6.0") field(DRVL, "-6.0") field(LOPR, "-6.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "YCOR:AS01:222:CALBIMAX") } record(ao, "YCOR:AS01:222:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "6.0") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVL, "-6.0") field(EGU, "A") field(VAL, "6.0") field(FLNK, "YCOR:AS01:222:CALBSTEPNUM") } record(ao, "YCOR:AS01:222:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(VAL, "0") } record(longout, "YCOR:AS01:222: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, "YCOR:AS01:222:CALBIDELTA") } record(calc, "YCOR:AS01:222:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "YCOR:AS01:222:CALBIMAX") field(INPB, "YCOR:AS01:222:CALBIMIN") field(INPC, "YCOR:AS01:222: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, "YCOR:AS01:222:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "MCOR:AS01:108:ISETPT.DRVH") field(INPB, "MCOR:AS01:108:IACT.HOPR") field(INPC, "YCOR:AS01:222:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "YCOR:AS01:222:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "YCOR:AS01:222:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "YCOR:AS01:222:DACSA") } # Used only for xygraph edm plot record(subArray, "YCOR:AS01:222:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "YCOR:AS01:222: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, "YCOR:AS01:222:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "YCOR:AS01:222:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "YCOR:AS01:222:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "YCOR:AS01:222: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, "YCOR:AS01:222:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "YCOR:AS01:222:CALBYSA") } # Used only for xygraph edm plot record(subArray, "YCOR:AS01:222:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "YCOR:AS01:222:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "YCOR:AS01:222:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "YCOR:AS01:222:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "YCOR:AS01:222:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "YCOR:AS01:222:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "YCOR:AS01:222:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "YCOR:AS01:222: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, "YCOR:AS01:222:CALBSTEPNUM") field(INPB, "YCOR:AS01:222:CALBIACTWF") field(INPC, "YCOR:AS01:222: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, "YCOR:AS01:222: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, "YCOR:AS01:222:STDZITOL") field(INPH, "YCOR:AS01:222:DACSLOPE") field(INPI, "YCOR:AS01:222: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, "YCOR:AS01:222: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, "YCOR:AS01:222:CALBSTEPNUM") field(INPB, "YCOR:AS01:222:CALBIACTWF") field(INPC, "YCOR:AS01:222:DACWF") field(INPF, "YCOR:AS01:222: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 YCOR:AS01:222CALBOK 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, "YCOR:AS01:222:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "YCOR:AS01:222:DEGAUSIMIN.PROC PP") field(OUTB, "YCOR:AS01:222:DEGAUSIMAX.PROC PP") field(OUTC, "YCOR:AS01:222:DEGAUSTYPE.PROC PP") field(OUTD, "YCOR:AS01:222:DEGAUSSTEP.PROC PP") field(OUTE, "YCOR:AS01:222:MADNAME.PROC PP") field(OUTF, "YCOR:AS01:222:PSTYPE.PROC PP") field(OUTG, "YCOR:AS01:222: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, "YCOR:AS01:222:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "YCOR:AS01:222:DEGAUSIMIN NPP NMS") field(INPB, "YCOR:AS01:222:DEGAUSIMAX NPP NMS") field(INPC, "YCOR:AS01:222:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "YCOR:AS01:222:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "YCOR:AS01:222:PSTYPE NPP NMS") field(INPG, "YCOR:AS01:222:DEBUG.RVAL NPP NMS") field(INPH, "YCOR:AS01:222: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, "YCOR:AS01:222:DEGAUSWF PP") field(OUTB, "YCOR:AS01:222:DEGAUSMSG PP") field(OUTC, "YCOR:AS01:222: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, "YCOR:AS01:222:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"YCOR:AS01:222: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, "YCOR:AS01:222: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, "YCOR:AS01:222: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, "YCOR:AS01:222: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, "YCOR:AS01:222: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, "YCOR:AS01:222:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(VAL, "-6.0") } record(ao, "YCOR:AS01:222:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(VAL, "6.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,"YCOR:AS01:222: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, "YCOR:AS01:222: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,"YCOR:AS01:222: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, "YCOR:AS01:222: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, "YCOR:AS01:222: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, "YCOR:AS01:222: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, "YCOR:AS01:222:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "YCOR:AS01:222:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "YCOR:AS01:222:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "YCOR:AS01:222:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "YCOR:AS01:222: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, "YCOR:AS01:222:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "YCOR:AS01:222: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, "YCOR:AS01:222:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "YCOR:AS01:222:DEGAUS_IMAX") field(INPB, "YCOR:AS01:222:ISETPT") field(INPC, "YCOR:AS01:222:DEGAUSTYPE.RVAL") field(OUT, "YCOR:AS01:222:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "YCOR:AS01:222:DEGAUS_IMAX_UPDATE") } record(seq, "YCOR:AS01:222:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "YCOR:AS01:222:ISETPT") field(LNK1, "YCOR:AS01:222:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "YCOR:AS01:222:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(VAL, "6.0") field(FLNK, "YCOR:AS01:222:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "YCOR:AS01:222:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "YCOR:AS01:222:DEGAUS_IMAX") field(FLNK, "YCOR:AS01:222:DEGAUS_IMAXPOL") } record(bo, "YCOR:AS01:222:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "YCOR:AS01:222:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "YCOR:AS01:222: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, "YCOR:AS01:222:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "YCOR:AS01:222:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "6.0") field(LOPR, "-6.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "YCOR:AS01:222:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "YCOR:AS01:222:IACT") field(INPB, "YCOR:AS01:222:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "YCOR:AS01:222:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "YCOR:AS01:222:IACTPOL") } record(bo, "YCOR:AS01:222: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,"YCOR:AS01:222: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, "YCOR:AS01:222:DEGAUSENABLE CP") field(INPB, "YCOR:AS01:222:DEGAUSOK") field(INPC, "YCOR:AS01:222:STATE CP") field(INPD, "YCOR:AS01:222:STATE.SEVR") field(OUT, "YCOR:AS01:222:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "YCOR:AS01:222:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "YCOR:AS01:222:DEGAUS_STATE_CHECK") field(LNK1, "YCOR:AS01:222:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "YCOR:AS01:222:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "YCOR:AS01:222:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "YCOR:AS01:222: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, "YCOR:AS01:222:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "YCOR:AS01:222:DEGAUSOK.ZSV") field(LNK2, "YCOR:AS01:222: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, "YCOR:AS01:222:STATMSG.FRSV") field(LNK4, "YCOR:AS01:222: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, "YCOR:AS01:222:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "YCOR:AS01:222:DEGAUSOK.ZSV") field(LNK2, "YCOR:AS01:222: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, "YCOR:AS01:222:STATMSG.FRSV") field(LNK4, "YCOR:AS01:222: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, "YCOR:AS01:222:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "YCOR:AS01:222: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, "YCOR:AS01:222:STATMSG.FRSV") field(LNK3, "YCOR:AS01:222: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, "YCOR:AS01:222:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "YCOR:AS01:222: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, "YCOR:AS01:222:STATMSG.FRSV PP") field(LNK3, "YCOR:AS01:222:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "YCOR:AS01:222:FUNC") { field(DESC, "YCOR:AS01:222 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, "0") field(NIVL, "0") field(TEVL, "0") field(ELVL, "5") field(TVVL, "6") field(TTVL, "7") field(FTVL, "4") field(FFVL, "3") field(OUT, "YCOR:AS01:222:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "YCOR:AS01:222:CTRL") { field(DESC, "YCOR:AS01:222 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, "") field(TVST, "") field(TTST, "") 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, "0") field(TVVL, "0") field(TTVL, "0") field(FTVL, "0") field(FFVL, "0") field(OUT, "YCOR:AS01:222:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "YCOR:AS01:222:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "YCOR:AS01:222:BUSY") } # Set to FREE on IOC reboot record(bo, "YCOR:AS01:222:BUSY") { field(DESC, "YCOR:AS01:222 Ctrl Done") field(DOL, "YCOR:AS01:222:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "YCOR:AS01:222:SELECT") } record(bo, "YCOR:AS01:222:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "YCOR:AS01:222: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, "YCOR:AS01:222:CTRLSTATE") { field(DESC, "YCOR:AS01:222 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("YCOR:AS01:222:CTRL",20,20,0,0,"YCOR:AS01:222:CTRL") #! Field("YCOR:AS01:222:CTRL.OUT",16777215,1,"YCOR:AS01:222:CTRL.OUT") #! Link("YCOR:AS01:222:CTRL.OUT","YCOR:AS01:222:SELECTEN.A") #! Field("YCOR:AS01:222:CTRL.VAL",16777215,1,"YCOR:AS01:222:CTRL.VAL") #! Record("YCOR:AS01:222:SELECTEN",321,381,0,0,"YCOR:AS01:222:SELECTEN") #! Field("YCOR:AS01:222:SELECTEN.A",16777215,0,"YCOR:AS01:222:SELECTEN.A") #! Field("YCOR:AS01:222:SELECTEN.FLNK",16777215,1,"YCOR:AS01:222:SELECTEN.FLNK") #! Link("YCOR:AS01:222:SELECTEN.FLNK","YCOR:AS01:222:BUSY") #! Field("YCOR:AS01:222:SELECTEN.VAL",16777215,1,"YCOR:AS01:222:SELECTEN.VAL") #! Record("YCOR:AS01:222:BUSY",623,274,0,0,"YCOR:AS01:222:BUSY") #! Field("YCOR:AS01:222:BUSY.DOL",16777215,0,"YCOR:AS01:222:BUSY.DOL") #! Link("YCOR:AS01:222:BUSY.DOL","YCOR:AS01:222:SELECTEN.VAL") #! Field("YCOR:AS01:222:BUSY.FLNK",16777215,1,"YCOR:AS01:222:BUSY.FLNK") #! Link("YCOR:AS01:222:BUSY.FLNK","YCOR:AS01:222:SELECT") #! Record("YCOR:AS01:222:SELECT",669,508,0,1,"YCOR:AS01:222:SELECT") #! Record("YCOR:AS01:222:FUNC",940,120,0,0,"YCOR:AS01:222:FUNC") #! Field("YCOR:AS01:222:FUNC.OUT",16777215,0,"YCOR:AS01:222:FUNC.OUT") #! Link("YCOR:AS01:222:FUNC.OUT","YCOR:AS01:222:CTRL.VAL") #! Record("YCOR:AS01:222:ABORT",193,41,0,0,"YCOR:AS01:222:ABORT") #! Record("YCOR:AS01:222:CTRLSTATE",369,34,0,0,"YCOR:AS01:222: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,"YCOR:AS01:222:SELECT is used for Multi-device selection.\nIt is enabled when associated YCOR:AS01:222:CTRL is \"0\" (DONE).\nIt is disabled when associated YCOR:AS01:222: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,"YCOR:AS01:222: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, "YCOR:AS01:222:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "YCOR:AS01:222:BCTRL.SEVR") field(OUT, "YCOR:AS01:222: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, "YCOR:AS01:222:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "YCOR:AS01:222:BACT") field(INPB, "YCOR:AS01:222:POLYCOEF") field(INPC, "YCOR:AS01:222:POLYCOEF.A") field(INPD, "YCOR:AS01:222:POLYCOEF.B") field(INPE, "YCOR:AS01:222:IACT MS") field(INPF, "YCOR:AS01:222:BDELTAS PP") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "110.0") field(LOPR, "-110.0") field(HIHI, "110.0") field(LOLO, "-110.0") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "110.0") field(LOW, "-110.0") field(FLNK, "YCOR:AS01:222: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, "YCOR:AS01:222: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, "YCOR:AS01:222:BDES") field(INPB, "YCOR:AS01:222:TRIMBTOL") field(INPC, "YCOR:AS01:222:TRIMBTOLR") field(INPD, "YCOR:AS01:222:CHCKBTOL") field(INPE, "YCOR:AS01:222:CHCKBTOLR") field(F, "0.0") field(INPG, "30") field(INPH, "YCOR:AS01:222:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "YCOR:AS01:222:MPSBTOL") field(INPQ, "YCOR:AS01:222:MPSBTOLR") field(FLNK, "YCOR:AS01:222:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "YCOR:AS01:222:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "YCOR:AS01:222:BDES") field(INPB, "YCOR:AS01:222:BDELTAS.I") field(INPG, "YCOR:AS01:222:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "YCOR:AS01:222:BCON.HIGH") field(OUTB, "YCOR:AS01:222:BCON.LOW") field(OUTC, "YCOR:AS01:222:BCON.HIHI") field(OUTD, "YCOR:AS01:222:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "YCOR:AS01:222:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "YCOR:AS01:222:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "YCOR:AS01:222:BDIFF") field(LNK2, "YCOR:AS01:222:BADIFF") field(LNK3, "YCOR:AS01:222:BRATIO") field(LNK4, "YCOR:AS01:222:MPSLIMITS") field(LNK5, "YCOR:AS01:222:I2BSTATUS") field(LNK6, "YCOR:AS01:222:IACTFO.PROC") } record(calc, "YCOR:AS01:222:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "YCOR:AS01:222:BDES") field(INPB, "YCOR:AS01:222:BACT") field(EGU, "kG-m") field(PREC, "7") } record(calc, "YCOR:AS01:222:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "YCOR:AS01:222:BDIFF") field(EGU, "kG-m") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "YCOR:AS01:222:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "YCOR:AS01:222:BDIFF") field(INPB, "YCOR:AS01:222:BDES.HOPR") field(EGU, "kG-m") field(PREC, "7") } record(mbbi, "YCOR:AS01:222: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, "YCOR:AS01:222:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "YCOR:AS01:222:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "YCOR:AS01:222:BMON") field(INPB, "YCOR:AS01:222:POLYCOEF") field(INPC, "YCOR:AS01:222:POLYCOEF.A") field(INPD, "YCOR:AS01:222:POLYCOEF.B") field(INPE, "YCOR:AS01:222:IMON MS") field(INPF, "YCOR:AS01:222:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "110.0") field(LOPR, "-110.0") field(HIHI, "110.0") field(LOLO, "-110.0") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "110.0") field(LOW, "-110.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=MCOR:AS01:108:BDES CP record(ao, "YCOR:AS01:222:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "110.0") field(DRVL, "-110.0") field(HOPR, "110.0") field(LOPR, "-110.0") field(PREC, "7") field(EGU, "kG-m") field(MDEL, "-1") field(OMSL, "supervisory") # field(DOL, "") field(OUT, "YCOR:AS01:222:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "YCOR:AS01:222:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "YCOR:AS01:222:POLYCOEF") field(INPC, "YCOR:AS01:222:POLYCOEF.A") field(INPD, "YCOR:AS01:222:POLYCOEF.B") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "110.0") field(LOPR, "-110.0") field(MDEL, "-1") field(INPE, "YCOR:AS01:222:BDES.DRVH") field(INPF, "YCOR:AS01:222:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "YCOR:AS01:222:IDES") } record(sub, "YCOR:AS01:222:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "YCOR:AS01:222:POLYCOEF") field(INPC, "YCOR:AS01:222:POLYCOEF.A") field(INPD, "YCOR:AS01:222:POLYCOEF.B") field(INPE, "YCOR:AS01:222:BDES.DRVH") field(INPF, "YCOR:AS01:222:BDES.DRVL") field(EGU, "kG-m") field(HOPR, "110.0") field(LOPR, "-110.0") field(PREC, "7") field(VAL, "0.0") field(FLNK, "YCOR:AS01:222:INOM") } record(sub, "YCOR:AS01:222:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "YCOR:AS01:222:BDES.VAL") field(INPB, "YCOR:AS01:222:BDES.DRVH") field(INPC, "YCOR:AS01:222:BDES.DRVL") field(INPD, "YCOR:AS01:222:BDELTAS.I") field(INPE, "YCOR:AS01:222:BDELTAS.J") field(INPG, "YCOR:AS01:222:STATE") field(INPH, "YCOR:AS01:222:HSTA") field(EGU, "kG-m") field(HOPR, "110.0") field(LOPR, "-110.0") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "YCOR:AS01:222:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "YCOR:AS01:222:BDES.VAL") field(INPB, "YCOR:AS01:222:BDES.DRVH") field(INPC, "YCOR:AS01:222:BDES.DRVL") field(INPD, "YCOR:AS01:222:BDELTAS.K") field(INPE, "YCOR:AS01:222:BDELTAS.L") field(INPG, "YCOR:AS01:222:STATE") field(INPH, "YCOR:AS01:222:HSTA") field(EGU, "kG-m") field(HOPR, "110.0") field(LOPR, "-110.0") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "YCOR:AS01:222:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "YCOR:AS01:222:BLIMITS") field(LNK1, "YCOR:AS01:222:BACTLIMITS.F PP") field(DOL2, "YCOR:AS01:222:BACTLIMITS.I") field(LNK2, "YCOR:AS01:222:BACT.HIGH") field(DOL3, "YCOR:AS01:222:BACTLIMITS.J") field(LNK3, "YCOR:AS01:222:BACT.LOW") field(DOL4, "YCOR:AS01:222:BACTLIMITS.K") field(LNK4, "YCOR:AS01:222:BACT.HIHI") field(DOL5, "YCOR:AS01:222:BACTLIMITS.L") field(LNK5, "YCOR:AS01:222:BACT.LOLO") field(DOL6, "YCOR:AS01:222:BLIMITS") field(LNK6, "YCOR:AS01:222:BMONLIMITS.F PP") field(DOL7, "YCOR:AS01:222:BMONLIMITS.I") field(LNK7, "YCOR:AS01:222:BMON.HIGH") field(DOL8, "YCOR:AS01:222:BMONLIMITS.J") field(LNK8, "YCOR:AS01:222:BMON.LOW") field(DOL9, "YCOR:AS01:222:BMONLIMITS.K") field(LNK9, "YCOR:AS01:222:BMON.HIHI") field(DOLA, "YCOR:AS01:222:BMONLIMITS.L") field(LNKA, "YCOR:AS01:222:BMON.LOLO") field(FLNK, "YCOR:AS01:222:ILIMITS") field(SCAN, "5 second") } record(ao, "YCOR:AS01:222:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG-m") field(DRVH, "110.0") field(DRVL, "-110.0") field(HOPR, "110.0") field(LOPR, "-110.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, "YCOR:AS01:222: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, "YCOR:AS01:222:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "YCOR:AS01:222:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "YCOR:AS01:222:BCTRL.VAL") field(LNK2, "YCOR:AS01:222:BDES PP") field(DOL3, "1") field(LNK3, "YCOR:AS01:222:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "YCOR:AS01:222:CHECKSTDZLOST.PROC PP") field(DOL5, "YCOR:AS01:222:BCTRL.VAL") field(LNK5, "YCOR:AS01:222:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "YCOR:AS01:222:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "YCOR:AS01:222:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "YCOR:AS01:222:POLYCOEF") field(INPC, "YCOR:AS01:222:POLYCOEF.A") field(INPD, "YCOR:AS01:222:POLYCOEF.B") field(INPE, "YCOR:AS01:222:BDES.DRVH") field(INPF, "YCOR:AS01:222:BDES.DRVL") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "110.0") field(LOPR, "-110.0") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "YCOR:AS01:222:ISETPT") } record(ao, "YCOR:AS01:222:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "110.0") field(DRVL, "-110.0") field(EGU, "kG-m") field(HOPR, "110.0") field(LOPR, "-110.0") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "YCOR:AS01:222:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "YC01S") } record(ai, "YCOR:AS01:222: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, "2019.595") } record(ao, "YCOR:AS01:222:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "110.0") field(DRVL, "-110.0") field(EGU, "kG-m") field(HOPR, "110.0") field(LOPR, "-110.0") field(PREC, "7") field(PINI, "YES") field(VAL, "110.0") field(FLNK, "YCOR:AS01:222:BSTEP") } record(ao, "YCOR:AS01:222:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "110.0") field(DRVL, "-110.0") field(EGU, "kG-m") field(HOPR, "110.0") field(LOPR, "-110.0") field(PREC, "7") field(PINI, "YES") field(VAL, "-110.0") field(FLNK, "YCOR:AS01:222:BSTEP") } record(ao, "YCOR:AS01:222:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "110.0") field(DRVL, "-110.0") field(EGU, "kG-m") field(HOPR, "110.0") field(LOPR, "-110.0") field(PINI, "YES") field(PREC, "7") } # This record is processed by YCOR:AS01:222: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, "YCOR:AS01:222:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "110.0") field(LOPR, "-110.0") field(DRVH, "110.0") field(DRVL, "-110.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, "YCOR:AS01:222:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "YCOR:AS01:222:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "YCOR:AS01:222:POLYCOEF") field(INPC, "YCOR:AS01:222:POLYCOEF.A") field(INPD, "YCOR:AS01:222:POLYCOEF.B") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "110.0") field(LOPR, "-110.0") field(MDEL, "-1") field(INPE, "YCOR:AS01:222:BCON.DRVH") field(INPF, "YCOR:AS01:222:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "YCOR:AS01:222: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, "YCOR:AS01:222:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "YCOR:AS01:222:BMAX") field(INPB, "YCOR:AS01:222:BMIN") field(INPC, "YCOR:AS01:222:BMIN.SEVR") field(INPD, "YCOR:AS01:222: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,"YCOR:AS01:222:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "YCOR:AS01:222:ONLINE CP") field(OUT, "YCOR:AS01:222:BCTRLDISABLEFOUT PP") } record(fanout, "YCOR:AS01:222:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "YCOR:AS01:222:BCTRLDISABLECALC") field(LNK1, "YCOR:AS01:222:BCTRLDISABLE") field(LNK2, "YCOR:AS01:222:BCTRLENABLE") } record(stringout, "YCOR:AS01:222:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "YCOR:AS01:222:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "YCOR:AS01:222:BCTRLDISV_UPDATE") } record(stringout, "YCOR:AS01:222:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "YCOR:AS01:222:BCTRL.ASG") field(VAL, "") field(FLNK, "YCOR:AS01:222:BCTRLDISV_UPDATE") } record(calcout, "YCOR:AS01:222:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "YCOR:AS01:222:ONLINE") field(OUT, "YCOR:AS01:222: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,"YCOR:AS01:222:BACT and MON\n are processed via links from \n YCOR:AS01:222:IACT (device raw value readback 1)\n and\n YCOR:AS01:222: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 YCOR:AS01:222:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = YCOR:AS01:222: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,"YCOR:AS01:222:BDES\n is processed when set by CA users or \n YCOR:AS01:222: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,"YCOR:AS01:222: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 YCOR:AS01:222: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 (YCOR:AS01:222: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,"YCOR:AS01:222:B*LIMITS and YCOR:AS01:222:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from YCOR:AS01:222: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,"YCOR:AS01:222: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,"YCOR:AS01:222: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, "YCOR:AS01:222: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, "YCOR:AS01:222:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG-m") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "YCOR:AS01:222:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "YCOR:AS01:222:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "110.0") field(DRVL, "-110.0") field(PINI, "YES") field(VAL, "110.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "YCOR:AS01:222:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "110.0") field(DRVL, "-110.0") field(PINI, "YES") field(VAL, "-110.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "YCOR:AS01:222:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "110.0") field(DRVL, "-110.0") field(PINI, "YES") field(VAL, "-110.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "YCOR:AS01:222:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "110.0") field(DRVL, "-110.0") field(PINI, "YES") field(VAL, "-110.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "YCOR:AS01:222: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, "YCOR:AS01:222:MPSLIMITS.E PP") } record(aSub, "YCOR:AS01:222: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, "YCOR:AS01:222:MPS.RVAL") field(INPB, "YCOR:AS01:222:BADIFF") field(INPC, "YCOR:AS01:222:BDELTAS.N") field(INPD, "YCOR:AS01:222:BACT") field(INPE, "YCOR:AS01:222:MPSBITMASK.RVAL") field(INPF, "YCOR:AS01:222:MPSBLLIM") field(INPG, "YCOR:AS01:222:MPSBMIN") field(INPH, "YCOR:AS01:222:MPSBMAX") field(INPI, "YCOR:AS01:222: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, "YCOR:AS01:222:INTOL.RVAL PP") field(OUTB, "YCOR:AS01:222:INTOL_BMIN.RVAL PP") field(OUTC, "YCOR:AS01:222:INTOL_BRANGE.RVAL PP") field(OUTD, "YCOR:AS01:222: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, "YCOR:AS01:222:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "YCOR:AS01:222:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "YCOR:AS01:222:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "YCOR:AS01:222:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "YCOR:AS01:222:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "YCOR:AS01:222:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "YCOR:AS01:222:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "YCOR:AS01:222: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, "YCOR:AS01:222:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "YCOR:AS01:222:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "YCOR:AS01:222:CHCKBTOL") field(INPB, "YCOR:AS01:222:POLYCOEF.B") field(PREC, "9") } record(calc, "YCOR:AS01:222: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, "YCOR:AS01:222:CHCKBTOL") field(FLNK, "YCOR:AS01:222:CHCKITOL") } record(calc, "YCOR:AS01:222:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "YCOR:AS01:222:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "YCOR:AS01:222:BDES.HOPR") field(INPB, "YCOR:AS01:222:STABILITY") field(INPC, "YCOR:AS01:222:BDES.LOPR") } record(longout, "YCOR:AS01:222:STABILITY") { field(DESC, "Long Term Stability") field(PINI, "YES") field(VAL, "1000") field(EGU, "ppm") field(DRVH, "3000") field(DRVL, "100") field(HOPR, "3000") field(LOPR, "100") field(FLNK, "YCOR:AS01:222:CHCKBTOL") } record(calc, "YCOR:AS01:222:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG-m") field(CALC, "ABS(A*B)") field(INPA, "YCOR:AS01:222:POLYCOEF.B") field(INPB, "YCOR:AS01:222:TRIMBTOL") field(PREC, "9") } record(ai, "YCOR:AS01:222:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "YCOR:AS01:222: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, "YCOR:AS01:222:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "YCOR:AS01:222:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "YCOR:AS01:222:PAUGO") } record(fanout, "YCOR:AS01:222:PAUGO") { field(DESC, "PAU control") field(LNK1, "YCOR:AS01:222:PAUSTOP") field(LNK2, "YCOR:AS01:222: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, "YCOR:AS01:222:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "YCOR:AS01:222:PAU.RVAL") field(DISV, "0") field(DOL1, "0") field(DOL2, "0") field(DOL3, "1") field(DLY3, "1") # field(LNK1, "MCOR:AS01:108:ISETPT.DISV") # field(LNK2, "MCOR:AS01:108:VSETPT.DISV") # field(LNK3, "ACTPAU PP") } record(seq, "YCOR:AS01:222:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "YCOR:AS01:222:PAU.RVAL") field(DISV, "1") field(DOL1, "1") field(DOL2, "1") field(DOL3, "0") # field(LNK1, "MCOR:AS01:108:ISETPT.DISV") # field(LNK2, "MCOR:AS01:108:VSETPT.DISV") # field(LNK3, "ACTPAU PP") } # Change attribute to PSDEVNAME record(stringout, "YCOR:AS01:222:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "MCOR:AS01:108:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "YCOR:AS01:222: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, "YCOR:AS01:222:PSTYPE.RVAL") field(INPC, "YCOR:AS01:222:TURNEDOFF.RVAL") field(INPD, "YCOR:AS01:222:CONFIG.RVAL") field(INPE, "YCOR:AS01:222:PSCATEGORY.RVAL") field(INPF, "YCOR:AS01:222:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "YCOR:AS01:222:AUTOCTRL.RVAL") field(INPJ, "YCOR:AS01:222:OUTOFSERVICE.RVAL") field(INPL, "YCOR:AS01:222:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "YCOR:AS01:222:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "YCOR:AS01:222:PAU") field(INPP, "YCOR:AS01:222:CALBDISABLE.RVAL") field(INPQ, "YCOR:AS01:222:PTRBDISABLE.RVAL") field(INPR, "YCOR:AS01:222:TRIMDISABLE.RVAL") field(INPS, "YCOR:AS01:222:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "YCOR:AS01:222:FBCK") field(INPU, "YCOR:AS01:222:TRIMTYPE.RVAL") field(INPV, "YCOR:AS01:222:STDZDIRECT.RVAL") field(INPW, "YCOR:AS01:222:DEGAUSENABLE.RVAL") field(FLNK, "YCOR:AS01:222:HSTA") } record(longin, "YCOR:AS01:222:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "YCOR:AS01:222:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "YCOR:AS01:222: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, "YCOR:AS01:222: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, "YCOR:AS01:222: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, "YCOR:AS01:222: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, "YCOR:AS01:222: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, "YCOR:AS01:222: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 YCOR:AS01:222:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses YCOR:AS01:222:FBCK. # This PV should be replaced by YCOR:AS01:222: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, "YCOR:AS01:222: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, "YCOR:AS01:222: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, "YCOR:AS01:222: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, "YCOR:AS01:222:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"YCOR:AS01:222:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "YCOR:AS01:222:OUTOFSERVICE NPP NMS") field(OUT, "YCOR:AS01:222:ONLINE PP") } record(bo, "YCOR:AS01:222:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "YCOR:AS01:222: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, "YCOR:AS01:222: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, "YCOR:AS01:222: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, "YCOR:AS01:222: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, "YCOR:AS01:222: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, "YCOR:AS01:222: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, "YCOR:AS01:222: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, "YCOR:AS01:222: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, "YCOR:AS01:222: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, "0") field(ASG, "NOWRITE") } record(mbbo, "YCOR:AS01:222: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, "0") field(ASG, "NOWRITE") } record(mbbo, "YCOR:AS01:222: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, "YCOR:AS01:222:TRIMTYPE") } record(stringout, "YCOR:AS01:222:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "YCOR:AS01:222:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "YCOR:AS01:222:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "YCOR:AS01:222:STATE.RVAL") field(INPB, "YCOR:AS01:222:INTLKSUMY.RVAL") field(OUT, "YCOR:AS01:222:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "YCOR:AS01:222: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, "YCOR:AS01:222:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "YCOR:AS01:222:STATE.RVAL") field(INPB, "YCOR:AS01:222:INTLKSUMY.RVAL") field(OUT, "YCOR:AS01:222:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "YCOR:AS01:222:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "YCOR:AS01:222:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "YCOR:AS01:222: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, "YCOR:AS01:222: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, "YCOR:AS01:222: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, "YCOR:AS01:222: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,"YCOR:AS01:222: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("YCOR:AS01:222:TURNEDOFF",3140,1907,0,1,"YCOR:AS01:222:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "YCOR:AS01:222:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "YCOR:AS01:222:BACT.STAT") field(INPB, "YCOR:AS01:222:BDES.STAT") field(INPC, "YCOR:AS01:222:IRIPL.STAT") field(INPD, "MCOR:AS01:108:VSETPT.STAT") field(INPE, "MCOR:AS01:108:VACT.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, "YCOR:AS01:222:BACT.SEVR") field(INPH, "YCOR:AS01:222:BDES.SEVR") field(INPI, "YCOR:AS01:222:IRIPL.SEVR") field(INPJ, "MCOR:AS01:108:VSETPT.SEVR") field(INPK, "MCOR:AS01:108:VACT.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, "YCOR:AS01:222:STATE.RVAL") field(INPN, "YCOR:AS01:222:STDZOK") field(INPO, "YCOR:AS01:222:CALBOK") field(INPP, "YCOR:AS01:222:OUTOFSERVICE.RVAL") field(INPQ, "YCOR:AS01:222:CONFIG.RVAL") field(INPR, "YCOR:AS01:222:HSTA") field(INPS, "YCOR:AS01:222:CTRL.RVAL") field(INPT, "YCOR:AS01:222:DEGAUSOK") field(INPV, "YCOR:AS01:222: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, "YCOR:AS01:222:STAT") } record(longout, "YCOR:AS01:222:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "YCOR:AS01:222:STATCTRLSUB") field(DOL, "YCOR:AS01:222:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "YCOR:AS01:222:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "YCOR:AS01:222:STAT") field(INPB, "YCOR:AS01:222:HSTA") field(INPD, "YCOR:AS01:222:ONOFFCTRL.RVAL") field(FLNK, "YCOR:AS01:222:STATMSG") } record(mbbo, "YCOR:AS01:222: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, "YCOR:AS01:222:UNAVAILGO") field(DOL, "YCOR:AS01:222:STATCTRLSUB.W") } record(seq, "YCOR:AS01:222:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "YCOR:AS01:222:STATSUB.U") field(LNK1, "YCOR:AS01:222:UNAVAIL PP") } record(stringout, "YCOR:AS01:222:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"YCOR:AS01:222:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - YCOR:AS01:222:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - YCOR:AS01:222: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,"YCOR:AS01:222STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - YCOR:AS01:222:STATUS\nC - YCOR:AS01:222:ON\nD - YCOR:AS01:222:STDZOK\nE - YCOR:AS01:222:CALBOK\nF - YCOR:AS01:222:BACTDRIFT (future)\nG -\nH- YCOR:AS01:222:DACSTATUS\nI -YCOR:AS01:222:ADCSTATUS\nJ - YCOR:AS01:222:BACTSTATUS\nK - YCOR:AS01:222:BDESSTATUS\nL - YCOR:AS01:222:RIPLSTATUS\n\nOutput:\nP - YCOR:AS01:222: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, "YCOR:AS01:222: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, "YCOR:AS01:222: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, "YCOR:AS01:222: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, "YCOR:AS01:222: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 # Note: for slave with trim coils # set the macro ACT to the following: # ACT=:IACTCALC record(ai, "XCOR:AS01:321:IACT") { field(DESC, "Current") field(INP, "MCOR:AS01:111:IACT") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "XCOR:AS01:321:BACT") info(autosaveFields,"HYST") } record(bi, "XCOR:AS01:321:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "MCOR:AS01:111:STATE NPP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "XCOR:AS01:321:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "6.0") field(LOLO, "-6.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "XCOR:AS01:321:BDELTAS") field(DRVH, "6.0") field(DRVL, "-6.0") field(DOL, "XCOR:AS01:321: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, "XCOR:AS01:321:ICTRL PP") } # This record is processed by XCOR:AS01:321:ICON") # Note: we are not setting alarms here. record(ao, "XCOR:AS01:321:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(DOL, "XCOR:AS01:321:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "XCOR:AS01:321:INOM") { field(DESC, "Nominal Current") field(DOL, "XCOR:AS01:321:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "6.0") field(DRVL, "-6.0") field(HOPR, "6.0") field(LOPR, "-6.0") } record(ao, "XCOR:AS01:321:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(MDEL, "-1") field(FLNK, "XCOR:AS01:321:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "XCOR:AS01:321:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "XCOR:AS01:321:ISETPT.OMSL") field(DOL2, "XCOR:AS01:321:ICTRL") field(LNK2, "XCOR:AS01:321:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "XCOR:AS01:321:ISETPT.OMSL") } record(ao, "XCOR:AS01:321:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "6.0") field(DRVL, "-6.0") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(PINI, "YES") field(VAL, "6.0") field(FLNK, "XCOR:AS01:321:IMIN") } record(ao, "XCOR:AS01:321:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "6.0") field(DRVL, "-6.0") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(VAL, "-6.0") field(FLNK, "XCOR:AS01:321:IRANGE") } record(sel, "XCOR:AS01:321:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(NVL, "XCOR:AS01:321:BACT.SEVR") field(INPA, "XCOR:AS01:321:IACT NPP MS") field(INPB, "XCOR:AS01:321:IACTPREVOK NPP MS") field(INPC, "XCOR:AS01:321:IACTPREVOK NPP MS") field(INPD, "XCOR:AS01:321:IACTPREVOK NPP MS") } record(sub, "XCOR:AS01:321:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "XCOR:AS01:321:IDES") field(INPB, "XCOR:AS01:321:ISETPT.DRVH") field(INPC, "XCOR:AS01:321:ISETPT.DRVL") field(INPD, "XCOR:AS01:321:IDELTAS.I") field(INPE, "XCOR:AS01:321:IDELTAS.J") field(INPG, "XCOR:AS01:321:STATE") field(INPH, "XCOR:AS01:321:HSTA") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "XCOR:AS01:321:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "XCOR:AS01:321:IDES") field(INPB, "XCOR:AS01:321:ISETPT.DRVH") field(INPC, "XCOR:AS01:321:ISETPT.DRVL") field(INPD, "XCOR:AS01:321:IDELTAS.K") field(INPE, "XCOR:AS01:321:IDELTAS.L") field(INPG, "XCOR:AS01:321:STATE") field(INPH, "XCOR:AS01:321:HSTA") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "XCOR:AS01:321:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "XCOR:AS01:321:BLIMITS") field(LNK1, "XCOR:AS01:321:IACTLIMITS.F PP") field(DOL2, "XCOR:AS01:321:IACTLIMITS.I") field(LNK2, "XCOR:AS01:321:IACT.HIGH") field(DOL3, "XCOR:AS01:321:IACTLIMITS.J") field(LNK3, "XCOR:AS01:321:IACT.LOW") field(DOL4, "XCOR:AS01:321:IACTLIMITS.K") field(LNK4, "XCOR:AS01:321:IACT.HIHI") field(DOL5, "XCOR:AS01:321:IACTLIMITS.L") field(LNK5, "XCOR:AS01:321:IACT.LOLO") field(DOL6, "XCOR:AS01:321:BLIMITS") field(LNK6, "XCOR:AS01:321:IMONLIMITS.F PP") field(DOL7, "XCOR:AS01:321:IMONLIMITS.I") field(LNK7, "XCOR:AS01:321:IMON.HIGH") field(DOL8, "XCOR:AS01:321:IMONLIMITS.J") field(LNK8, "XCOR:AS01:321:IMON.LOW") field(DOL9, "XCOR:AS01:321:IMONLIMITS.K") field(LNK9, "XCOR:AS01:321:IMON.HIHI") field(DOLA, "XCOR:AS01:321:IMONLIMITS.L") field(LNKA, "XCOR:AS01:321: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, "XCOR:AS01:321:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "XCOR:AS01:321:TRIMBTOL") field(INPE, "XCOR:AS01:321:CHCKBTOL") field(INPF, "XCOR:AS01:321:BDELTAS.K") field(INPG, "XCOR:AS01:321:BDELTAS.L") field(INPH, "XCOR:AS01:321: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, "XCOR:AS01:321:STDZITOLR") field(INPC, "XCOR:AS01:321:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = MCOR:AS01:111: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, "XCOR:AS01:321: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 = MCOR:AS01:111:RESET PP # record(bo, "XCOR:AS01:321:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "MCOR:AS01:111:RESET PP") } record(bo, "XCOR:AS01:321:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "") 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, "XCOR:AS01:321: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, "XCOR:AS01:321:TRIMRAMPRATE") field(OUT, "") field(FLNK, "XCOR:AS01:321:STDZDLY") } record(ao, "XCOR:AS01:321:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(MDEL, "-1") field(OUT, "MCOR:AS01:111:ISETPT PP") field(DOL, "XCOR:AS01:321: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, "XCOR:AS01:321:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "XCOR:AS01:321:BMON") } record(ao, "XCOR:AS01:321:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "XCOR:AS01:321:IRIPLOK") } record(sub, "XCOR:AS01:321:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "XCOR:AS01:321:IRIPL.VAL") field(INPB, "XCOR:AS01:321: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, "XCOR:AS01:321: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, "XCOR:AS01:321:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") } record(bi, "XCOR:AS01:321:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "MCOR:AS01:111:INTLKSUMY NPP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "XCOR:AS01:321: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, "MCOR:AS01:111:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "XCOR:AS01:321:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "XCOR:AS01:321:IACTPREVOK") field(LNK2, "XCOR:AS01:321:IDIFF") field(LNK3, "XCOR:AS01:321:IADIFF") field(LNK4, "XCOR:AS01:321:IRATIO") field(LNK5, "XCOR:AS01:321:IDIRECT") field(LNK6, "XCOR:AS01:321:IACTPOL_CHECK") } record(calc, "XCOR:AS01:321:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "XCOR:AS01:321:IDES") field(INPB, "XCOR:AS01:321:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "6.0") field(LOPR, "-6.0") } record(calc, "XCOR:AS01:321:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "XCOR:AS01:321:IDIFF") field(PREC, "9") } record(calc, "XCOR:AS01:321:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "XCOR:AS01:321:IDIFF") field(INPB, "XCOR:AS01:321:IDES.DRVH") field(PREC, "9") } record(calcout, "XCOR:AS01:321:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "XCOR:AS01:321:IMIN") field(INPB, "XCOR:AS01:321: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, "XCOR:AS01:321: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, "XCOR:AS01:321:IACT") field(FLNK, "XCOR:AS01:321:IACTPOL") } record(bo, "XCOR:AS01:321:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "XCOR:AS01:321: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,"XCOR:AS01:321:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from XCOR:AS01:321:IDELTAS and the\n XCOR:AS01:321: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,"XCOR:AS01:321:IACT: \n Get copy of XCOR:AS01:321:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"XCOR:AS01:321: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,"XCOR:AS01:321:IDES:\n Contains raw value calculated by \nXCOR:AS01:321: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 \nXCOR:AS01:321:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"XCOR:AS01:321: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 XCOR:AS01:321: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 XCOR:AS01:321: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,"XCOR:AS01:321:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by XCOR:AS01:321:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, XCOR:AS01:321:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n XCOR:AS01:321: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, "XCOR:AS01:321:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "XCOR:AS01:321:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "XCOR:AS01:321:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "XCOR:AS01:321:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "XCOR:AS01:321:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "XCOR:AS01:321:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "0") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "XCOR:AS01:321: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, "XCOR:AS01:321:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "XCOR:AS01:321:TRIMTYPE.RVAL") field(INPB, "XCOR:AS01:321:CONFIG.RVAL") field(OUT, "XCOR:AS01:321:TRIMMAXNUM PP") } record(longout, "XCOR:AS01:321: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, "XCOR:AS01:321: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, "closed_loop") field(VAL, "1") field(OUT, "XCOR:AS01:321:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "XCOR:AS01:321: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, "closed_loop") field(VAL, "10") } record(bo, "XCOR:AS01:321: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, "XCOR:AS01:321: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, "XCOR:AS01:321:TRIMSTEPMIN") { field(DESC, "Min step in current") field(DTYP, "Soft Channel") field(DOL, "MCOR:AS01:111:ISTEP") field(PREC, "7") field(EGUF, "10") field(EGUL, "0") field(EGU, "A") field(HOPR, "10") field(LOPR, "0") field(VAL, "0.0001") } record(bo, "XCOR:AS01:321:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "1") } record(ao, "XCOR:AS01:321: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, "XCOR:AS01:321:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "XCOR:AS01:321: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, "XCOR:AS01:321: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, "XCOR:AS01:321:IMOVE") field(INPB, "XCOR:AS01:321:IACT") field(INPC, "XCOR:AS01:321:IRAMPRATE") field(INPD, "1.0") field(INPE, "XCOR:AS01:321:TRIMDLYPCT") field(INPF, "XCOR:AS01:321:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "XCOR:AS01:321:RAMPTIME_LEFT PP") } record(longout, "XCOR:AS01:321:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "XCOR:AS01:321:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "XCOR:AS01:321:RAMPDONE_CALC") } record(calc, "XCOR:AS01:321:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "XCOR:AS01:321:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "XCOR:AS01:321:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "XCOR:AS01:321: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, "XCOR:AS01:321:RAMPTIME_LEFT") field(OUT, "XCOR:AS01:321:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "XCOR:AS01:321:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "XCOR:AS01:321:RAMPTIME_LEFT NMS") field(OUT, "XCOR:AS01:321:RAMPDONE PP") } record(bo, "XCOR:AS01:321:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "XCOR:AS01:321:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "XCOR:AS01:321: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, "XCOR:AS01:321: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, "XCOR:AS01:321:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "XCOR:AS01:321:DEBUG.PROC PP") field(LNK2, "XCOR:AS01:321:STDZCYCLENUM.PROC PP") field(LNK3, "XCOR:AS01:321:STDZDISABLE.PROC PP") field(LNK4, "XCOR:AS01:321: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, "XCOR:AS01:321:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "XCOR:AS01:321:STDZIMIN NPP NMS") field(INPB, "XCOR:AS01:321:STDZIMAX NPP NMS") field(INPC, "XCOR:AS01:321:STDZIFINAL NPP NMS") field(INPD, "XCOR:AS01:321:STDZCYCLENUM NPP NMS") field(INPE, "XCOR:AS01:321:STDZDIRECT.RVAL NPP NMS") field(INPF, "XCOR:AS01:321:STDZDISABLE.RVAL CPP NMS") field(INPG, "XCOR:AS01:321: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, "XCOR:AS01:321:STDZWF PP") field(OUTB, "XCOR:AS01:321: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, "XCOR:AS01:321:STDZWF") } record(mbbo, "XCOR:AS01:321: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, "XCOR:AS01:321: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, "XCOR:AS01:321:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "XCOR:AS01:321: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, "XCOR:AS01:321: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, "XCOR:AS01:321: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, "XCOR:AS01:321:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "XCOR:AS01:321:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "XCOR:AS01:321:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "XCOR:AS01:321: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, "XCOR:AS01:321:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "XCOR:AS01:321:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "XCOR:AS01:321:STDZIMIN") } record(ao, "XCOR:AS01:321:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(VAL, "-6.0") field(FLNK, "XCOR:AS01:321:STDZIMAX") } record(ao, "XCOR:AS01:321:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(VAL, "6.0") field(FLNK, "XCOR:AS01:321:STDZIFINAL") } record(ao, "XCOR:AS01:321:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(VAL, "-6.0") field(FLNK, "XCOR:AS01:321: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, "XCOR:AS01:321: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, "XCOR:AS01:321:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "XCOR:AS01:321:STDZIMIN CP NMS") field(INPB, "XCOR:AS01:321:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "XCOR:AS01:321:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "XCOR:AS01:321:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "XCOR:AS01:321:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "XCOR:AS01:321:STDZIMIN CP NMS") field(INPB, "XCOR:AS01:321:STDZIMAX CP NMS") field(INPC, "XCOR:AS01:321:TRIMRAMPRATE CP NMS") field(INPD, "1.0") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "XCOR:AS01:321:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "XCOR:AS01:321:TRIMDLYPCT CP MS") field(INPB, "XCOR:AS01:321: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, "XCOR:AS01:321:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "XCOR:AS01:321: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, "XCOR:AS01:321:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "XCOR:AS01:321:IDES.HOPR") field(INPB, "XCOR:AS01:321:STDZMINIPCT CPP NMS") field(INPC, "XCOR:AS01:321:IDES.LOPR") field(PREC, "5") } record(calc, "XCOR:AS01:321:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "XCOR:AS01:321:IDES.HOPR") field(INPB, "XCOR:AS01:321:IDES.LOPR") field(INPC, "XCOR:AS01:321:STDZDIRECT.RVAL") field(INPD, "XCOR:AS01:321:STDZMINIDELTA") field(INPE, "XCOR:AS01:321:IDES") field(PREC, "5") field(FLNK, "XCOR:AS01:321: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, "XCOR:AS01:321:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "XCOR:AS01:321:IDES.HOPR") field(INPB, "XCOR:AS01:321:IDES.LOPR") field(INPC, "XCOR:AS01:321:STDZDIRECT.RVAL") field(INPD, "XCOR:AS01:321:STDZMINIDELTA") field(INPE, "XCOR:AS01:321: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, "XCOR:AS01:321: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, "XCOR:AS01:321:IADJUST.RVAL") field(INPB, "XCOR:AS01:321:STDZDIRECT.RVAL") field(INPC, "XCOR:AS01:321:STDZOK.RVAL") field(INPD, "XCOR:AS01:321:STDZDISABLE.RVAL") field(INPE, "XCOR:AS01:321:STATE.RVAL CPP NMS") field(INPF, "XCOR:AS01:321:ICTRL.RVAL") field(INPG, "XCOR:AS01:321:STATE.SEVR") field(INPH, "XCOR:AS01:321:BDELTAS.M") field(INPI, "XCOR:AS01:321:IACT.SEVR") field(OUT, "XCOR:AS01:321:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "XCOR:AS01:321:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "XCOR:AS01:321:STDZLOSTTOD.PROC") field(LNK2, "XCOR:AS01:321:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "XCOR:AS01:321:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "XCOR:AS01:321:CHECKPWRDIP_ENABLE") field(INPA, "XCOR:AS01:321:IACT CP") field(INPB, "XCOR:AS01:321:STDZIACTMAX") field(EGU, "A") field(FLNK, "XCOR:AS01:321: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, "XCOR:AS01:321:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "XCOR:AS01:321:CHECKPWRDIP_ENABLE") field(INPA, "XCOR:AS01:321:STDZIACTMAX") field(INPB, "XCOR:AS01:321:IACT") field(INPC, "XCOR:AS01:321:IDELTAS.I") field(OUT, "XCOR:AS01:321: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, "XCOR:AS01:321:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "XCOR:AS01:321:STDZOK.RVAL CP") field(INPB, "XCOR:AS01:321:STDZDISABLE.RVAL CP") field(INPC, "XCOR:AS01:321: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, "XCOR:AS01:321: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, "XCOR:AS01:321:CALBOK") { field(DESC, "Successful Calibration") field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "") 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, "XCOR:AS01:321:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "XCOR:AS01:321:CALBOK") field(INPB, "XCOR:AS01:321:CALBDISABLE") field(INPC, "XCOR:AS01:321:CALBSLOPE") field(OOPT, "On Change") field(OUT, "XCOR:AS01:321: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, "XCOR:AS01:321:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "XCOR:AS01:321: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, "XCOR:AS01:321:CALBSLOPE") field(DOL3, "XCOR:AS01:321:CALBOFFSET") field(DOL4, "0") field(DOL5, "0") field(LNK1, "MCOR:AS01:111:VSETPT.DISA PP NMS") field(LNK2, "MCOR:AS01:111:VSETPT.ASLO PP NMS") field(LNK3, "MCOR:AS01:111:VSETPT.AOFF PP NMS") field(LNK4, "MCOR:AS01:111:VSETPT.LINR PP NMS") field(LNK5, "MCOR:AS01:111:VSETPT.DISA PP NMS") # # 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, "MCOR:AS01:111:VSETPT.DISA PP NMS") field(LNK7, "MCOR:AS01:111:VSETPT.ASLO PP NMS") field(LNK8, "MCOR:AS01:111:VSETPT.AOFF PP NMS") field(LNK9, "MCOR:AS01:111:VSETPT.LINR PP NMS") field(LNKA, "MCOR:AS01:111:VSETPT.DISA PP NMS") } record(stringout, "XCOR:AS01:321:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "XCOR:AS01:321: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, "XCOR:AS01:321: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, "XCOR:AS01:321: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, "XCOR:AS01:321:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "XCOR:AS01:321: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, "XCOR:AS01:321:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "MCOR:AS01:111:VSETPT.ESLO") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "XCOR:AS01:321:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "XCOR:AS01:321:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "MCOR:AS01:111:VSETPT.EOFF") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "XCOR:AS01:321: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, "XCOR:AS01:321:CALCDAC") { field(DESC, "IACT to DAC Counts") field(CALC, "D=0?0:(((C*A)+B)-E)/D") field(INPA, "MCOR:AS01:111:I2VSLOPE") field(INPB, "0.0") field(INPC, "XCOR:AS01:321:IACT") field(INPD, "XCOR:AS01:321:DACSLOPE") field(INPE, "XCOR:AS01:321:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "XCOR:AS01:321:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "MCOR:AS01:111:VSETPT.RVAL CP") field(OMSL, "closed_loop") field(PREC, "6") field(PINI, "YES") } record(ao, "XCOR:AS01:321:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "6.0") field(HOPR, "6.0") field(DRVL, "-6.0") field(LOPR, "-6.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "XCOR:AS01:321:CALBIMAX") } record(ao, "XCOR:AS01:321:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "6.0") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVL, "-6.0") field(EGU, "A") field(VAL, "6.0") field(FLNK, "XCOR:AS01:321:CALBSTEPNUM") } record(ao, "XCOR:AS01:321:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(VAL, "0") } record(longout, "XCOR:AS01:321: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, "XCOR:AS01:321:CALBIDELTA") } record(calc, "XCOR:AS01:321:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "XCOR:AS01:321:CALBIMAX") field(INPB, "XCOR:AS01:321:CALBIMIN") field(INPC, "XCOR:AS01:321: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, "XCOR:AS01:321:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "MCOR:AS01:111:ISETPT.DRVH") field(INPB, "MCOR:AS01:111:IACT.HOPR") field(INPC, "XCOR:AS01:321:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "XCOR:AS01:321:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "XCOR:AS01:321:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "XCOR:AS01:321:DACSA") } # Used only for xygraph edm plot record(subArray, "XCOR:AS01:321:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "XCOR:AS01:321: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, "XCOR:AS01:321:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "XCOR:AS01:321:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "XCOR:AS01:321:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "XCOR:AS01:321: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, "XCOR:AS01:321:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "XCOR:AS01:321:CALBYSA") } # Used only for xygraph edm plot record(subArray, "XCOR:AS01:321:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "XCOR:AS01:321:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "XCOR:AS01:321:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "XCOR:AS01:321:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "XCOR:AS01:321:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "XCOR:AS01:321:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "XCOR:AS01:321:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "XCOR:AS01:321: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, "XCOR:AS01:321:CALBSTEPNUM") field(INPB, "XCOR:AS01:321:CALBIACTWF") field(INPC, "XCOR:AS01:321: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, "XCOR:AS01:321: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, "XCOR:AS01:321:STDZITOL") field(INPH, "XCOR:AS01:321:DACSLOPE") field(INPI, "XCOR:AS01:321: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, "XCOR:AS01:321: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, "XCOR:AS01:321:CALBSTEPNUM") field(INPB, "XCOR:AS01:321:CALBIACTWF") field(INPC, "XCOR:AS01:321:DACWF") field(INPF, "XCOR:AS01:321: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 XCOR:AS01:321CALBOK 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, "XCOR:AS01:321:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "XCOR:AS01:321:DEGAUSIMIN.PROC PP") field(OUTB, "XCOR:AS01:321:DEGAUSIMAX.PROC PP") field(OUTC, "XCOR:AS01:321:DEGAUSTYPE.PROC PP") field(OUTD, "XCOR:AS01:321:DEGAUSSTEP.PROC PP") field(OUTE, "XCOR:AS01:321:MADNAME.PROC PP") field(OUTF, "XCOR:AS01:321:PSTYPE.PROC PP") field(OUTG, "XCOR:AS01:321: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, "XCOR:AS01:321:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "XCOR:AS01:321:DEGAUSIMIN NPP NMS") field(INPB, "XCOR:AS01:321:DEGAUSIMAX NPP NMS") field(INPC, "XCOR:AS01:321:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "XCOR:AS01:321:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "XCOR:AS01:321:PSTYPE NPP NMS") field(INPG, "XCOR:AS01:321:DEBUG.RVAL NPP NMS") field(INPH, "XCOR:AS01:321: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, "XCOR:AS01:321:DEGAUSWF PP") field(OUTB, "XCOR:AS01:321:DEGAUSMSG PP") field(OUTC, "XCOR:AS01:321: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, "XCOR:AS01:321:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"XCOR:AS01:321: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, "XCOR:AS01:321: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, "XCOR:AS01:321: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, "XCOR:AS01:321: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, "XCOR:AS01:321: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, "XCOR:AS01:321:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(VAL, "-6.0") } record(ao, "XCOR:AS01:321:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(VAL, "6.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,"XCOR:AS01:321: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, "XCOR:AS01:321: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,"XCOR:AS01:321: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, "XCOR:AS01:321: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, "XCOR:AS01:321: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, "XCOR:AS01:321: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, "XCOR:AS01:321:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "XCOR:AS01:321:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "XCOR:AS01:321:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "XCOR:AS01:321:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "XCOR:AS01:321: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, "XCOR:AS01:321:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "XCOR:AS01:321: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, "XCOR:AS01:321:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "XCOR:AS01:321:DEGAUS_IMAX") field(INPB, "XCOR:AS01:321:ISETPT") field(INPC, "XCOR:AS01:321:DEGAUSTYPE.RVAL") field(OUT, "XCOR:AS01:321:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "XCOR:AS01:321:DEGAUS_IMAX_UPDATE") } record(seq, "XCOR:AS01:321:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "XCOR:AS01:321:ISETPT") field(LNK1, "XCOR:AS01:321:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "XCOR:AS01:321:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(VAL, "6.0") field(FLNK, "XCOR:AS01:321:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "XCOR:AS01:321:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "XCOR:AS01:321:DEGAUS_IMAX") field(FLNK, "XCOR:AS01:321:DEGAUS_IMAXPOL") } record(bo, "XCOR:AS01:321:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "XCOR:AS01:321:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "XCOR:AS01:321: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, "XCOR:AS01:321:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "XCOR:AS01:321:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "6.0") field(LOPR, "-6.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "XCOR:AS01:321:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "XCOR:AS01:321:IACT") field(INPB, "XCOR:AS01:321:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "XCOR:AS01:321:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "XCOR:AS01:321:IACTPOL") } record(bo, "XCOR:AS01:321: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,"XCOR:AS01:321: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, "XCOR:AS01:321:DEGAUSENABLE CP") field(INPB, "XCOR:AS01:321:DEGAUSOK") field(INPC, "XCOR:AS01:321:STATE CP") field(INPD, "XCOR:AS01:321:STATE.SEVR") field(OUT, "XCOR:AS01:321:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "XCOR:AS01:321:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "XCOR:AS01:321:DEGAUS_STATE_CHECK") field(LNK1, "XCOR:AS01:321:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "XCOR:AS01:321:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "XCOR:AS01:321:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "XCOR:AS01:321: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, "XCOR:AS01:321:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "XCOR:AS01:321:DEGAUSOK.ZSV") field(LNK2, "XCOR:AS01:321: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, "XCOR:AS01:321:STATMSG.FRSV") field(LNK4, "XCOR:AS01:321: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, "XCOR:AS01:321:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "XCOR:AS01:321:DEGAUSOK.ZSV") field(LNK2, "XCOR:AS01:321: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, "XCOR:AS01:321:STATMSG.FRSV") field(LNK4, "XCOR:AS01:321: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, "XCOR:AS01:321:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "XCOR:AS01:321: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, "XCOR:AS01:321:STATMSG.FRSV") field(LNK3, "XCOR:AS01:321: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, "XCOR:AS01:321:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "XCOR:AS01:321: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, "XCOR:AS01:321:STATMSG.FRSV PP") field(LNK3, "XCOR:AS01:321:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "XCOR:AS01:321:FUNC") { field(DESC, "XCOR:AS01:321 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, "0") field(NIVL, "0") field(TEVL, "0") field(ELVL, "5") field(TVVL, "6") field(TTVL, "7") field(FTVL, "4") field(FFVL, "3") field(OUT, "XCOR:AS01:321:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "XCOR:AS01:321:CTRL") { field(DESC, "XCOR:AS01:321 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, "") field(TVST, "") field(TTST, "") 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, "0") field(TVVL, "0") field(TTVL, "0") field(FTVL, "0") field(FFVL, "0") field(OUT, "XCOR:AS01:321:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "XCOR:AS01:321:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "XCOR:AS01:321:BUSY") } # Set to FREE on IOC reboot record(bo, "XCOR:AS01:321:BUSY") { field(DESC, "XCOR:AS01:321 Ctrl Done") field(DOL, "XCOR:AS01:321:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "XCOR:AS01:321:SELECT") } record(bo, "XCOR:AS01:321:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "XCOR:AS01:321: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, "XCOR:AS01:321:CTRLSTATE") { field(DESC, "XCOR:AS01:321 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("XCOR:AS01:321:CTRL",20,20,0,0,"XCOR:AS01:321:CTRL") #! Field("XCOR:AS01:321:CTRL.OUT",16777215,1,"XCOR:AS01:321:CTRL.OUT") #! Link("XCOR:AS01:321:CTRL.OUT","XCOR:AS01:321:SELECTEN.A") #! Field("XCOR:AS01:321:CTRL.VAL",16777215,1,"XCOR:AS01:321:CTRL.VAL") #! Record("XCOR:AS01:321:SELECTEN",321,381,0,0,"XCOR:AS01:321:SELECTEN") #! Field("XCOR:AS01:321:SELECTEN.A",16777215,0,"XCOR:AS01:321:SELECTEN.A") #! Field("XCOR:AS01:321:SELECTEN.FLNK",16777215,1,"XCOR:AS01:321:SELECTEN.FLNK") #! Link("XCOR:AS01:321:SELECTEN.FLNK","XCOR:AS01:321:BUSY") #! Field("XCOR:AS01:321:SELECTEN.VAL",16777215,1,"XCOR:AS01:321:SELECTEN.VAL") #! Record("XCOR:AS01:321:BUSY",623,274,0,0,"XCOR:AS01:321:BUSY") #! Field("XCOR:AS01:321:BUSY.DOL",16777215,0,"XCOR:AS01:321:BUSY.DOL") #! Link("XCOR:AS01:321:BUSY.DOL","XCOR:AS01:321:SELECTEN.VAL") #! Field("XCOR:AS01:321:BUSY.FLNK",16777215,1,"XCOR:AS01:321:BUSY.FLNK") #! Link("XCOR:AS01:321:BUSY.FLNK","XCOR:AS01:321:SELECT") #! Record("XCOR:AS01:321:SELECT",669,508,0,1,"XCOR:AS01:321:SELECT") #! Record("XCOR:AS01:321:FUNC",940,120,0,0,"XCOR:AS01:321:FUNC") #! Field("XCOR:AS01:321:FUNC.OUT",16777215,0,"XCOR:AS01:321:FUNC.OUT") #! Link("XCOR:AS01:321:FUNC.OUT","XCOR:AS01:321:CTRL.VAL") #! Record("XCOR:AS01:321:ABORT",193,41,0,0,"XCOR:AS01:321:ABORT") #! Record("XCOR:AS01:321:CTRLSTATE",369,34,0,0,"XCOR:AS01:321: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,"XCOR:AS01:321:SELECT is used for Multi-device selection.\nIt is enabled when associated XCOR:AS01:321:CTRL is \"0\" (DONE).\nIt is disabled when associated XCOR:AS01:321: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,"XCOR:AS01:321: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, "XCOR:AS01:321:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "XCOR:AS01:321:BCTRL.SEVR") field(OUT, "XCOR:AS01:321: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, "XCOR:AS01:321:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "XCOR:AS01:321:BACT") field(INPB, "XCOR:AS01:321:POLYCOEF") field(INPC, "XCOR:AS01:321:POLYCOEF.A") field(INPD, "XCOR:AS01:321:POLYCOEF.B") field(INPE, "XCOR:AS01:321:IACT MS") field(INPF, "XCOR:AS01:321:BDELTAS PP") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "107.4") field(LOPR, "-107.4") field(HIHI, "107.4") field(LOLO, "-107.4") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "107.4") field(LOW, "-107.4") field(FLNK, "XCOR:AS01:321: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, "XCOR:AS01:321: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, "XCOR:AS01:321:BDES") field(INPB, "XCOR:AS01:321:TRIMBTOL") field(INPC, "XCOR:AS01:321:TRIMBTOLR") field(INPD, "XCOR:AS01:321:CHCKBTOL") field(INPE, "XCOR:AS01:321:CHCKBTOLR") field(F, "0.0") field(INPG, "30") field(INPH, "XCOR:AS01:321:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "XCOR:AS01:321:MPSBTOL") field(INPQ, "XCOR:AS01:321:MPSBTOLR") field(FLNK, "XCOR:AS01:321:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "XCOR:AS01:321:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "XCOR:AS01:321:BDES") field(INPB, "XCOR:AS01:321:BDELTAS.I") field(INPG, "XCOR:AS01:321:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "XCOR:AS01:321:BCON.HIGH") field(OUTB, "XCOR:AS01:321:BCON.LOW") field(OUTC, "XCOR:AS01:321:BCON.HIHI") field(OUTD, "XCOR:AS01:321:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "XCOR:AS01:321:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "XCOR:AS01:321:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "XCOR:AS01:321:BDIFF") field(LNK2, "XCOR:AS01:321:BADIFF") field(LNK3, "XCOR:AS01:321:BRATIO") field(LNK4, "XCOR:AS01:321:MPSLIMITS") field(LNK5, "XCOR:AS01:321:I2BSTATUS") field(LNK6, "XCOR:AS01:321:IACTFO.PROC") } record(calc, "XCOR:AS01:321:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "XCOR:AS01:321:BDES") field(INPB, "XCOR:AS01:321:BACT") field(EGU, "kG-m") field(PREC, "7") } record(calc, "XCOR:AS01:321:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "XCOR:AS01:321:BDIFF") field(EGU, "kG-m") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "XCOR:AS01:321:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "XCOR:AS01:321:BDIFF") field(INPB, "XCOR:AS01:321:BDES.HOPR") field(EGU, "kG-m") field(PREC, "7") } record(mbbi, "XCOR:AS01:321: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, "XCOR:AS01:321:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "XCOR:AS01:321:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "XCOR:AS01:321:BMON") field(INPB, "XCOR:AS01:321:POLYCOEF") field(INPC, "XCOR:AS01:321:POLYCOEF.A") field(INPD, "XCOR:AS01:321:POLYCOEF.B") field(INPE, "XCOR:AS01:321:IMON MS") field(INPF, "XCOR:AS01:321:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "107.4") field(LOPR, "-107.4") field(HIHI, "107.4") field(LOLO, "-107.4") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "107.4") field(LOW, "-107.4") } # 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=MCOR:AS01:111:BDES CP record(ao, "XCOR:AS01:321:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "107.4") field(DRVL, "-107.4") field(HOPR, "107.4") field(LOPR, "-107.4") field(PREC, "7") field(EGU, "kG-m") field(MDEL, "-1") field(OMSL, "supervisory") # field(DOL, "") field(OUT, "XCOR:AS01:321:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "XCOR:AS01:321:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "XCOR:AS01:321:POLYCOEF") field(INPC, "XCOR:AS01:321:POLYCOEF.A") field(INPD, "XCOR:AS01:321:POLYCOEF.B") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "107.4") field(LOPR, "-107.4") field(MDEL, "-1") field(INPE, "XCOR:AS01:321:BDES.DRVH") field(INPF, "XCOR:AS01:321:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "XCOR:AS01:321:IDES") } record(sub, "XCOR:AS01:321:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "XCOR:AS01:321:POLYCOEF") field(INPC, "XCOR:AS01:321:POLYCOEF.A") field(INPD, "XCOR:AS01:321:POLYCOEF.B") field(INPE, "XCOR:AS01:321:BDES.DRVH") field(INPF, "XCOR:AS01:321:BDES.DRVL") field(EGU, "kG-m") field(HOPR, "107.4") field(LOPR, "-107.4") field(PREC, "7") field(VAL, "0.0") field(FLNK, "XCOR:AS01:321:INOM") } record(sub, "XCOR:AS01:321:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "XCOR:AS01:321:BDES.VAL") field(INPB, "XCOR:AS01:321:BDES.DRVH") field(INPC, "XCOR:AS01:321:BDES.DRVL") field(INPD, "XCOR:AS01:321:BDELTAS.I") field(INPE, "XCOR:AS01:321:BDELTAS.J") field(INPG, "XCOR:AS01:321:STATE") field(INPH, "XCOR:AS01:321:HSTA") field(EGU, "kG-m") field(HOPR, "107.4") field(LOPR, "-107.4") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "XCOR:AS01:321:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "XCOR:AS01:321:BDES.VAL") field(INPB, "XCOR:AS01:321:BDES.DRVH") field(INPC, "XCOR:AS01:321:BDES.DRVL") field(INPD, "XCOR:AS01:321:BDELTAS.K") field(INPE, "XCOR:AS01:321:BDELTAS.L") field(INPG, "XCOR:AS01:321:STATE") field(INPH, "XCOR:AS01:321:HSTA") field(EGU, "kG-m") field(HOPR, "107.4") field(LOPR, "-107.4") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "XCOR:AS01:321:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "XCOR:AS01:321:BLIMITS") field(LNK1, "XCOR:AS01:321:BACTLIMITS.F PP") field(DOL2, "XCOR:AS01:321:BACTLIMITS.I") field(LNK2, "XCOR:AS01:321:BACT.HIGH") field(DOL3, "XCOR:AS01:321:BACTLIMITS.J") field(LNK3, "XCOR:AS01:321:BACT.LOW") field(DOL4, "XCOR:AS01:321:BACTLIMITS.K") field(LNK4, "XCOR:AS01:321:BACT.HIHI") field(DOL5, "XCOR:AS01:321:BACTLIMITS.L") field(LNK5, "XCOR:AS01:321:BACT.LOLO") field(DOL6, "XCOR:AS01:321:BLIMITS") field(LNK6, "XCOR:AS01:321:BMONLIMITS.F PP") field(DOL7, "XCOR:AS01:321:BMONLIMITS.I") field(LNK7, "XCOR:AS01:321:BMON.HIGH") field(DOL8, "XCOR:AS01:321:BMONLIMITS.J") field(LNK8, "XCOR:AS01:321:BMON.LOW") field(DOL9, "XCOR:AS01:321:BMONLIMITS.K") field(LNK9, "XCOR:AS01:321:BMON.HIHI") field(DOLA, "XCOR:AS01:321:BMONLIMITS.L") field(LNKA, "XCOR:AS01:321:BMON.LOLO") field(FLNK, "XCOR:AS01:321:ILIMITS") field(SCAN, "5 second") } record(ao, "XCOR:AS01:321:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG-m") field(DRVH, "107.4") field(DRVL, "-107.4") field(HOPR, "107.4") field(LOPR, "-107.4") # 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, "XCOR:AS01:321: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, "XCOR:AS01:321:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "XCOR:AS01:321:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "XCOR:AS01:321:BCTRL.VAL") field(LNK2, "XCOR:AS01:321:BDES PP") field(DOL3, "1") field(LNK3, "XCOR:AS01:321:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "XCOR:AS01:321:CHECKSTDZLOST.PROC PP") field(DOL5, "XCOR:AS01:321:BCTRL.VAL") field(LNK5, "XCOR:AS01:321:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "XCOR:AS01:321:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "XCOR:AS01:321:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "XCOR:AS01:321:POLYCOEF") field(INPC, "XCOR:AS01:321:POLYCOEF.A") field(INPD, "XCOR:AS01:321:POLYCOEF.B") field(INPE, "XCOR:AS01:321:BDES.DRVH") field(INPF, "XCOR:AS01:321:BDES.DRVL") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "107.4") field(LOPR, "-107.4") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "XCOR:AS01:321:ISETPT") } record(ao, "XCOR:AS01:321:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "107.4") field(DRVL, "-107.4") field(EGU, "kG-m") field(HOPR, "107.4") field(LOPR, "-107.4") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "XCOR:AS01:321:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "XC02S") } record(ai, "XCOR:AS01:321: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, "2019.850") } record(ao, "XCOR:AS01:321:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "107.4") field(DRVL, "-107.4") field(EGU, "kG-m") field(HOPR, "107.4") field(LOPR, "-107.4") field(PREC, "7") field(PINI, "YES") field(VAL, "107.4") field(FLNK, "XCOR:AS01:321:BSTEP") } record(ao, "XCOR:AS01:321:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "107.4") field(DRVL, "-107.4") field(EGU, "kG-m") field(HOPR, "107.4") field(LOPR, "-107.4") field(PREC, "7") field(PINI, "YES") field(VAL, "-107.4") field(FLNK, "XCOR:AS01:321:BSTEP") } record(ao, "XCOR:AS01:321:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "107.4") field(DRVL, "-107.4") field(EGU, "kG-m") field(HOPR, "107.4") field(LOPR, "-107.4") field(PINI, "YES") field(PREC, "7") } # This record is processed by XCOR:AS01:321: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, "XCOR:AS01:321:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "107.4") field(LOPR, "-107.4") field(DRVH, "107.4") field(DRVL, "-107.4") # 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, "XCOR:AS01:321:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "XCOR:AS01:321:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "XCOR:AS01:321:POLYCOEF") field(INPC, "XCOR:AS01:321:POLYCOEF.A") field(INPD, "XCOR:AS01:321:POLYCOEF.B") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "107.4") field(LOPR, "-107.4") field(MDEL, "-1") field(INPE, "XCOR:AS01:321:BCON.DRVH") field(INPF, "XCOR:AS01:321:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "XCOR:AS01:321: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, "XCOR:AS01:321:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "XCOR:AS01:321:BMAX") field(INPB, "XCOR:AS01:321:BMIN") field(INPC, "XCOR:AS01:321:BMIN.SEVR") field(INPD, "XCOR:AS01:321: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,"XCOR:AS01:321:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "XCOR:AS01:321:ONLINE CP") field(OUT, "XCOR:AS01:321:BCTRLDISABLEFOUT PP") } record(fanout, "XCOR:AS01:321:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "XCOR:AS01:321:BCTRLDISABLECALC") field(LNK1, "XCOR:AS01:321:BCTRLDISABLE") field(LNK2, "XCOR:AS01:321:BCTRLENABLE") } record(stringout, "XCOR:AS01:321:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "XCOR:AS01:321:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "XCOR:AS01:321:BCTRLDISV_UPDATE") } record(stringout, "XCOR:AS01:321:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "XCOR:AS01:321:BCTRL.ASG") field(VAL, "") field(FLNK, "XCOR:AS01:321:BCTRLDISV_UPDATE") } record(calcout, "XCOR:AS01:321:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "XCOR:AS01:321:ONLINE") field(OUT, "XCOR:AS01:321: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,"XCOR:AS01:321:BACT and MON\n are processed via links from \n XCOR:AS01:321:IACT (device raw value readback 1)\n and\n XCOR:AS01:321: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 XCOR:AS01:321:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = XCOR:AS01:321: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,"XCOR:AS01:321:BDES\n is processed when set by CA users or \n XCOR:AS01:321: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,"XCOR:AS01:321: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 XCOR:AS01:321: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 (XCOR:AS01:321: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,"XCOR:AS01:321:B*LIMITS and XCOR:AS01:321:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from XCOR:AS01:321: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,"XCOR:AS01:321: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,"XCOR:AS01:321: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, "XCOR:AS01:321: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, "XCOR:AS01:321:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG-m") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "XCOR:AS01:321:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "XCOR:AS01:321:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "107.4") field(DRVL, "-107.4") field(PINI, "YES") field(VAL, "107.4") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "XCOR:AS01:321:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "107.4") field(DRVL, "-107.4") field(PINI, "YES") field(VAL, "-107.4") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "XCOR:AS01:321:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "107.4") field(DRVL, "-107.4") field(PINI, "YES") field(VAL, "-107.4") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "XCOR:AS01:321:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "107.4") field(DRVL, "-107.4") field(PINI, "YES") field(VAL, "-107.4") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "XCOR:AS01:321: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, "XCOR:AS01:321:MPSLIMITS.E PP") } record(aSub, "XCOR:AS01:321: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, "XCOR:AS01:321:MPS.RVAL") field(INPB, "XCOR:AS01:321:BADIFF") field(INPC, "XCOR:AS01:321:BDELTAS.N") field(INPD, "XCOR:AS01:321:BACT") field(INPE, "XCOR:AS01:321:MPSBITMASK.RVAL") field(INPF, "XCOR:AS01:321:MPSBLLIM") field(INPG, "XCOR:AS01:321:MPSBMIN") field(INPH, "XCOR:AS01:321:MPSBMAX") field(INPI, "XCOR:AS01:321: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, "XCOR:AS01:321:INTOL.RVAL PP") field(OUTB, "XCOR:AS01:321:INTOL_BMIN.RVAL PP") field(OUTC, "XCOR:AS01:321:INTOL_BRANGE.RVAL PP") field(OUTD, "XCOR:AS01:321: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, "XCOR:AS01:321:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "XCOR:AS01:321:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "XCOR:AS01:321:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "XCOR:AS01:321:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "XCOR:AS01:321:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "XCOR:AS01:321:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "XCOR:AS01:321:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "XCOR:AS01:321: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, "XCOR:AS01:321:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "XCOR:AS01:321:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "XCOR:AS01:321:CHCKBTOL") field(INPB, "XCOR:AS01:321:POLYCOEF.B") field(PREC, "9") } record(calc, "XCOR:AS01:321: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, "XCOR:AS01:321:CHCKBTOL") field(FLNK, "XCOR:AS01:321:CHCKITOL") } record(calc, "XCOR:AS01:321:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "XCOR:AS01:321:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "XCOR:AS01:321:BDES.HOPR") field(INPB, "XCOR:AS01:321:STABILITY") field(INPC, "XCOR:AS01:321:BDES.LOPR") } record(longout, "XCOR:AS01:321:STABILITY") { field(DESC, "Long Term Stability") field(PINI, "YES") field(VAL, "1000") field(EGU, "ppm") field(DRVH, "3000") field(DRVL, "100") field(HOPR, "3000") field(LOPR, "100") field(FLNK, "XCOR:AS01:321:CHCKBTOL") } record(calc, "XCOR:AS01:321:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG-m") field(CALC, "ABS(A*B)") field(INPA, "XCOR:AS01:321:POLYCOEF.B") field(INPB, "XCOR:AS01:321:TRIMBTOL") field(PREC, "9") } record(ai, "XCOR:AS01:321:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "XCOR:AS01:321: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, "XCOR:AS01:321:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "XCOR:AS01:321:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "XCOR:AS01:321:PAUGO") } record(fanout, "XCOR:AS01:321:PAUGO") { field(DESC, "PAU control") field(LNK1, "XCOR:AS01:321:PAUSTOP") field(LNK2, "XCOR:AS01:321: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, "XCOR:AS01:321:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "XCOR:AS01:321:PAU.RVAL") field(DISV, "0") field(DOL1, "0") field(DOL2, "0") field(DOL3, "1") field(DLY3, "1") # field(LNK1, "MCOR:AS01:111:ISETPT.DISV") # field(LNK2, "MCOR:AS01:111:VSETPT.DISV") # field(LNK3, "ACTPAU PP") } record(seq, "XCOR:AS01:321:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "XCOR:AS01:321:PAU.RVAL") field(DISV, "1") field(DOL1, "1") field(DOL2, "1") field(DOL3, "0") # field(LNK1, "MCOR:AS01:111:ISETPT.DISV") # field(LNK2, "MCOR:AS01:111:VSETPT.DISV") # field(LNK3, "ACTPAU PP") } # Change attribute to PSDEVNAME record(stringout, "XCOR:AS01:321:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "MCOR:AS01:111:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "XCOR:AS01:321: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, "XCOR:AS01:321:PSTYPE.RVAL") field(INPC, "XCOR:AS01:321:TURNEDOFF.RVAL") field(INPD, "XCOR:AS01:321:CONFIG.RVAL") field(INPE, "XCOR:AS01:321:PSCATEGORY.RVAL") field(INPF, "XCOR:AS01:321:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "XCOR:AS01:321:AUTOCTRL.RVAL") field(INPJ, "XCOR:AS01:321:OUTOFSERVICE.RVAL") field(INPL, "XCOR:AS01:321:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "XCOR:AS01:321:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "XCOR:AS01:321:PAU") field(INPP, "XCOR:AS01:321:CALBDISABLE.RVAL") field(INPQ, "XCOR:AS01:321:PTRBDISABLE.RVAL") field(INPR, "XCOR:AS01:321:TRIMDISABLE.RVAL") field(INPS, "XCOR:AS01:321:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "XCOR:AS01:321:FBCK") field(INPU, "XCOR:AS01:321:TRIMTYPE.RVAL") field(INPV, "XCOR:AS01:321:STDZDIRECT.RVAL") field(INPW, "XCOR:AS01:321:DEGAUSENABLE.RVAL") field(FLNK, "XCOR:AS01:321:HSTA") } record(longin, "XCOR:AS01:321:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "XCOR:AS01:321:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "XCOR:AS01:321: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, "XCOR:AS01:321: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, "XCOR:AS01:321: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, "XCOR:AS01:321: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, "XCOR:AS01:321: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, "XCOR:AS01:321: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 XCOR:AS01:321:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses XCOR:AS01:321:FBCK. # This PV should be replaced by XCOR:AS01:321: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, "XCOR:AS01:321: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, "XCOR:AS01:321: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, "XCOR:AS01:321: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, "XCOR:AS01:321:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"XCOR:AS01:321:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "XCOR:AS01:321:OUTOFSERVICE NPP NMS") field(OUT, "XCOR:AS01:321:ONLINE PP") } record(bo, "XCOR:AS01:321:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "XCOR:AS01:321: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, "XCOR:AS01:321: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, "XCOR:AS01:321: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, "XCOR:AS01:321: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, "XCOR:AS01:321: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, "XCOR:AS01:321: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, "XCOR:AS01:321: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, "XCOR:AS01:321: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, "XCOR:AS01:321: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, "0") field(ASG, "NOWRITE") } record(mbbo, "XCOR:AS01:321: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, "0") field(ASG, "NOWRITE") } record(mbbo, "XCOR:AS01:321: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, "XCOR:AS01:321:TRIMTYPE") } record(stringout, "XCOR:AS01:321:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "XCOR:AS01:321:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "XCOR:AS01:321:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "XCOR:AS01:321:STATE.RVAL") field(INPB, "XCOR:AS01:321:INTLKSUMY.RVAL") field(OUT, "XCOR:AS01:321:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "XCOR:AS01:321: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, "XCOR:AS01:321:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "XCOR:AS01:321:STATE.RVAL") field(INPB, "XCOR:AS01:321:INTLKSUMY.RVAL") field(OUT, "XCOR:AS01:321:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "XCOR:AS01:321:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "XCOR:AS01:321:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "XCOR:AS01:321: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, "XCOR:AS01:321: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, "XCOR:AS01:321: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, "XCOR:AS01:321: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,"XCOR:AS01:321: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("XCOR:AS01:321:TURNEDOFF",3140,1907,0,1,"XCOR:AS01:321:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "XCOR:AS01:321:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "XCOR:AS01:321:BACT.STAT") field(INPB, "XCOR:AS01:321:BDES.STAT") field(INPC, "XCOR:AS01:321:IRIPL.STAT") field(INPD, "MCOR:AS01:111:VSETPT.STAT") field(INPE, "MCOR:AS01:111:VACT.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, "XCOR:AS01:321:BACT.SEVR") field(INPH, "XCOR:AS01:321:BDES.SEVR") field(INPI, "XCOR:AS01:321:IRIPL.SEVR") field(INPJ, "MCOR:AS01:111:VSETPT.SEVR") field(INPK, "MCOR:AS01:111:VACT.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, "XCOR:AS01:321:STATE.RVAL") field(INPN, "XCOR:AS01:321:STDZOK") field(INPO, "XCOR:AS01:321:CALBOK") field(INPP, "XCOR:AS01:321:OUTOFSERVICE.RVAL") field(INPQ, "XCOR:AS01:321:CONFIG.RVAL") field(INPR, "XCOR:AS01:321:HSTA") field(INPS, "XCOR:AS01:321:CTRL.RVAL") field(INPT, "XCOR:AS01:321:DEGAUSOK") field(INPV, "XCOR:AS01:321: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, "XCOR:AS01:321:STAT") } record(longout, "XCOR:AS01:321:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "XCOR:AS01:321:STATCTRLSUB") field(DOL, "XCOR:AS01:321:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "XCOR:AS01:321:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "XCOR:AS01:321:STAT") field(INPB, "XCOR:AS01:321:HSTA") field(INPD, "XCOR:AS01:321:ONOFFCTRL.RVAL") field(FLNK, "XCOR:AS01:321:STATMSG") } record(mbbo, "XCOR:AS01:321: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, "XCOR:AS01:321:UNAVAILGO") field(DOL, "XCOR:AS01:321:STATCTRLSUB.W") } record(seq, "XCOR:AS01:321:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "XCOR:AS01:321:STATSUB.U") field(LNK1, "XCOR:AS01:321:UNAVAIL PP") } record(stringout, "XCOR:AS01:321:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"XCOR:AS01:321:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - XCOR:AS01:321:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - XCOR:AS01:321: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,"XCOR:AS01:321STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - XCOR:AS01:321:STATUS\nC - XCOR:AS01:321:ON\nD - XCOR:AS01:321:STDZOK\nE - XCOR:AS01:321:CALBOK\nF - XCOR:AS01:321:BACTDRIFT (future)\nG -\nH- XCOR:AS01:321:DACSTATUS\nI -XCOR:AS01:321:ADCSTATUS\nJ - XCOR:AS01:321:BACTSTATUS\nK - XCOR:AS01:321:BDESSTATUS\nL - XCOR:AS01:321:RIPLSTATUS\n\nOutput:\nP - XCOR:AS01:321: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, "XCOR:AS01:321: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, "XCOR:AS01:321: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, "XCOR:AS01:321: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, "XCOR:AS01:321: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 # Note: for slave with trim coils # set the macro ACT to the following: # ACT=:IACTCALC record(ai, "YCOR:AS01:322:IACT") { field(DESC, "Current") field(INP, "MCOR:AS01:112:IACT") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "YCOR:AS01:322:BACT") info(autosaveFields,"HYST") } record(bi, "YCOR:AS01:322:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "MCOR:AS01:112:STATE NPP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "YCOR:AS01:322:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "6.0") field(LOLO, "-6.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "YCOR:AS01:322:BDELTAS") field(DRVH, "6.0") field(DRVL, "-6.0") field(DOL, "YCOR:AS01:322: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, "YCOR:AS01:322:ICTRL PP") } # This record is processed by YCOR:AS01:322:ICON") # Note: we are not setting alarms here. record(ao, "YCOR:AS01:322:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(DOL, "YCOR:AS01:322:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "YCOR:AS01:322:INOM") { field(DESC, "Nominal Current") field(DOL, "YCOR:AS01:322:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "6.0") field(DRVL, "-6.0") field(HOPR, "6.0") field(LOPR, "-6.0") } record(ao, "YCOR:AS01:322:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(MDEL, "-1") field(FLNK, "YCOR:AS01:322:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "YCOR:AS01:322:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "YCOR:AS01:322:ISETPT.OMSL") field(DOL2, "YCOR:AS01:322:ICTRL") field(LNK2, "YCOR:AS01:322:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "YCOR:AS01:322:ISETPT.OMSL") } record(ao, "YCOR:AS01:322:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "6.0") field(DRVL, "-6.0") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(PINI, "YES") field(VAL, "6.0") field(FLNK, "YCOR:AS01:322:IMIN") } record(ao, "YCOR:AS01:322:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "6.0") field(DRVL, "-6.0") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(VAL, "-6.0") field(FLNK, "YCOR:AS01:322:IRANGE") } record(sel, "YCOR:AS01:322:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(NVL, "YCOR:AS01:322:BACT.SEVR") field(INPA, "YCOR:AS01:322:IACT NPP MS") field(INPB, "YCOR:AS01:322:IACTPREVOK NPP MS") field(INPC, "YCOR:AS01:322:IACTPREVOK NPP MS") field(INPD, "YCOR:AS01:322:IACTPREVOK NPP MS") } record(sub, "YCOR:AS01:322:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "YCOR:AS01:322:IDES") field(INPB, "YCOR:AS01:322:ISETPT.DRVH") field(INPC, "YCOR:AS01:322:ISETPT.DRVL") field(INPD, "YCOR:AS01:322:IDELTAS.I") field(INPE, "YCOR:AS01:322:IDELTAS.J") field(INPG, "YCOR:AS01:322:STATE") field(INPH, "YCOR:AS01:322:HSTA") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "YCOR:AS01:322:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "YCOR:AS01:322:IDES") field(INPB, "YCOR:AS01:322:ISETPT.DRVH") field(INPC, "YCOR:AS01:322:ISETPT.DRVL") field(INPD, "YCOR:AS01:322:IDELTAS.K") field(INPE, "YCOR:AS01:322:IDELTAS.L") field(INPG, "YCOR:AS01:322:STATE") field(INPH, "YCOR:AS01:322:HSTA") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "YCOR:AS01:322:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "YCOR:AS01:322:BLIMITS") field(LNK1, "YCOR:AS01:322:IACTLIMITS.F PP") field(DOL2, "YCOR:AS01:322:IACTLIMITS.I") field(LNK2, "YCOR:AS01:322:IACT.HIGH") field(DOL3, "YCOR:AS01:322:IACTLIMITS.J") field(LNK3, "YCOR:AS01:322:IACT.LOW") field(DOL4, "YCOR:AS01:322:IACTLIMITS.K") field(LNK4, "YCOR:AS01:322:IACT.HIHI") field(DOL5, "YCOR:AS01:322:IACTLIMITS.L") field(LNK5, "YCOR:AS01:322:IACT.LOLO") field(DOL6, "YCOR:AS01:322:BLIMITS") field(LNK6, "YCOR:AS01:322:IMONLIMITS.F PP") field(DOL7, "YCOR:AS01:322:IMONLIMITS.I") field(LNK7, "YCOR:AS01:322:IMON.HIGH") field(DOL8, "YCOR:AS01:322:IMONLIMITS.J") field(LNK8, "YCOR:AS01:322:IMON.LOW") field(DOL9, "YCOR:AS01:322:IMONLIMITS.K") field(LNK9, "YCOR:AS01:322:IMON.HIHI") field(DOLA, "YCOR:AS01:322:IMONLIMITS.L") field(LNKA, "YCOR:AS01:322: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, "YCOR:AS01:322:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "YCOR:AS01:322:TRIMBTOL") field(INPE, "YCOR:AS01:322:CHCKBTOL") field(INPF, "YCOR:AS01:322:BDELTAS.K") field(INPG, "YCOR:AS01:322:BDELTAS.L") field(INPH, "YCOR:AS01:322: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, "YCOR:AS01:322:STDZITOLR") field(INPC, "YCOR:AS01:322:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = MCOR:AS01:112: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, "YCOR:AS01:322: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 = MCOR:AS01:112:RESET PP # record(bo, "YCOR:AS01:322:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "MCOR:AS01:112:RESET PP") } record(bo, "YCOR:AS01:322:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "") 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, "YCOR:AS01:322: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, "YCOR:AS01:322:TRIMRAMPRATE") field(OUT, "") field(FLNK, "YCOR:AS01:322:STDZDLY") } record(ao, "YCOR:AS01:322:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(MDEL, "-1") field(OUT, "MCOR:AS01:112:ISETPT PP") field(DOL, "YCOR:AS01:322: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, "YCOR:AS01:322:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "YCOR:AS01:322:BMON") } record(ao, "YCOR:AS01:322:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "YCOR:AS01:322:IRIPLOK") } record(sub, "YCOR:AS01:322:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "YCOR:AS01:322:IRIPL.VAL") field(INPB, "YCOR:AS01:322: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, "YCOR:AS01:322: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, "YCOR:AS01:322:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") } record(bi, "YCOR:AS01:322:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "MCOR:AS01:112:INTLKSUMY NPP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "YCOR:AS01:322: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, "MCOR:AS01:112:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "YCOR:AS01:322:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "YCOR:AS01:322:IACTPREVOK") field(LNK2, "YCOR:AS01:322:IDIFF") field(LNK3, "YCOR:AS01:322:IADIFF") field(LNK4, "YCOR:AS01:322:IRATIO") field(LNK5, "YCOR:AS01:322:IDIRECT") field(LNK6, "YCOR:AS01:322:IACTPOL_CHECK") } record(calc, "YCOR:AS01:322:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "YCOR:AS01:322:IDES") field(INPB, "YCOR:AS01:322:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "6.0") field(LOPR, "-6.0") } record(calc, "YCOR:AS01:322:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "YCOR:AS01:322:IDIFF") field(PREC, "9") } record(calc, "YCOR:AS01:322:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "YCOR:AS01:322:IDIFF") field(INPB, "YCOR:AS01:322:IDES.DRVH") field(PREC, "9") } record(calcout, "YCOR:AS01:322:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "YCOR:AS01:322:IMIN") field(INPB, "YCOR:AS01:322: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, "YCOR:AS01:322: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, "YCOR:AS01:322:IACT") field(FLNK, "YCOR:AS01:322:IACTPOL") } record(bo, "YCOR:AS01:322:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "YCOR:AS01:322: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,"YCOR:AS01:322:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from YCOR:AS01:322:IDELTAS and the\n YCOR:AS01:322: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,"YCOR:AS01:322:IACT: \n Get copy of YCOR:AS01:322:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"YCOR:AS01:322: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,"YCOR:AS01:322:IDES:\n Contains raw value calculated by \nYCOR:AS01:322: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 \nYCOR:AS01:322:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"YCOR:AS01:322: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 YCOR:AS01:322: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 YCOR:AS01:322: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,"YCOR:AS01:322:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by YCOR:AS01:322:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, YCOR:AS01:322:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n YCOR:AS01:322: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, "YCOR:AS01:322:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "YCOR:AS01:322:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "YCOR:AS01:322:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "YCOR:AS01:322:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "YCOR:AS01:322:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "YCOR:AS01:322:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "0") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "YCOR:AS01:322: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, "YCOR:AS01:322:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "YCOR:AS01:322:TRIMTYPE.RVAL") field(INPB, "YCOR:AS01:322:CONFIG.RVAL") field(OUT, "YCOR:AS01:322:TRIMMAXNUM PP") } record(longout, "YCOR:AS01:322: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, "YCOR:AS01:322: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, "closed_loop") field(VAL, "1") field(OUT, "YCOR:AS01:322:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "YCOR:AS01:322: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, "closed_loop") field(VAL, "10") } record(bo, "YCOR:AS01:322: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, "YCOR:AS01:322: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, "YCOR:AS01:322:TRIMSTEPMIN") { field(DESC, "Min step in current") field(DTYP, "Soft Channel") field(DOL, "MCOR:AS01:112:ISTEP") field(PREC, "7") field(EGUF, "10") field(EGUL, "0") field(EGU, "A") field(HOPR, "10") field(LOPR, "0") field(VAL, "0.0001") } record(bo, "YCOR:AS01:322:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "1") } record(ao, "YCOR:AS01:322: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, "YCOR:AS01:322:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "YCOR:AS01:322: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, "YCOR:AS01:322: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, "YCOR:AS01:322:IMOVE") field(INPB, "YCOR:AS01:322:IACT") field(INPC, "YCOR:AS01:322:IRAMPRATE") field(INPD, "1.0") field(INPE, "YCOR:AS01:322:TRIMDLYPCT") field(INPF, "YCOR:AS01:322:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "YCOR:AS01:322:RAMPTIME_LEFT PP") } record(longout, "YCOR:AS01:322:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "YCOR:AS01:322:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "YCOR:AS01:322:RAMPDONE_CALC") } record(calc, "YCOR:AS01:322:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "YCOR:AS01:322:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "YCOR:AS01:322:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "YCOR:AS01:322: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, "YCOR:AS01:322:RAMPTIME_LEFT") field(OUT, "YCOR:AS01:322:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "YCOR:AS01:322:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "YCOR:AS01:322:RAMPTIME_LEFT NMS") field(OUT, "YCOR:AS01:322:RAMPDONE PP") } record(bo, "YCOR:AS01:322:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "YCOR:AS01:322:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "YCOR:AS01:322: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, "YCOR:AS01:322: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, "YCOR:AS01:322:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "YCOR:AS01:322:DEBUG.PROC PP") field(LNK2, "YCOR:AS01:322:STDZCYCLENUM.PROC PP") field(LNK3, "YCOR:AS01:322:STDZDISABLE.PROC PP") field(LNK4, "YCOR:AS01:322: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, "YCOR:AS01:322:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "YCOR:AS01:322:STDZIMIN NPP NMS") field(INPB, "YCOR:AS01:322:STDZIMAX NPP NMS") field(INPC, "YCOR:AS01:322:STDZIFINAL NPP NMS") field(INPD, "YCOR:AS01:322:STDZCYCLENUM NPP NMS") field(INPE, "YCOR:AS01:322:STDZDIRECT.RVAL NPP NMS") field(INPF, "YCOR:AS01:322:STDZDISABLE.RVAL CPP NMS") field(INPG, "YCOR:AS01:322: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, "YCOR:AS01:322:STDZWF PP") field(OUTB, "YCOR:AS01:322: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, "YCOR:AS01:322:STDZWF") } record(mbbo, "YCOR:AS01:322: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, "YCOR:AS01:322: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, "YCOR:AS01:322:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "YCOR:AS01:322: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, "YCOR:AS01:322: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, "YCOR:AS01:322: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, "YCOR:AS01:322:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "YCOR:AS01:322:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "YCOR:AS01:322:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "YCOR:AS01:322: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, "YCOR:AS01:322:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "YCOR:AS01:322:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "YCOR:AS01:322:STDZIMIN") } record(ao, "YCOR:AS01:322:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(VAL, "-6.0") field(FLNK, "YCOR:AS01:322:STDZIMAX") } record(ao, "YCOR:AS01:322:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(VAL, "6.0") field(FLNK, "YCOR:AS01:322:STDZIFINAL") } record(ao, "YCOR:AS01:322:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(VAL, "-6.0") field(FLNK, "YCOR:AS01:322: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, "YCOR:AS01:322: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, "YCOR:AS01:322:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "YCOR:AS01:322:STDZIMIN CP NMS") field(INPB, "YCOR:AS01:322:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "YCOR:AS01:322:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "YCOR:AS01:322:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "YCOR:AS01:322:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "YCOR:AS01:322:STDZIMIN CP NMS") field(INPB, "YCOR:AS01:322:STDZIMAX CP NMS") field(INPC, "YCOR:AS01:322:TRIMRAMPRATE CP NMS") field(INPD, "1.0") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "YCOR:AS01:322:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "YCOR:AS01:322:TRIMDLYPCT CP MS") field(INPB, "YCOR:AS01:322: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, "YCOR:AS01:322:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "YCOR:AS01:322: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, "YCOR:AS01:322:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "YCOR:AS01:322:IDES.HOPR") field(INPB, "YCOR:AS01:322:STDZMINIPCT CPP NMS") field(INPC, "YCOR:AS01:322:IDES.LOPR") field(PREC, "5") } record(calc, "YCOR:AS01:322:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "YCOR:AS01:322:IDES.HOPR") field(INPB, "YCOR:AS01:322:IDES.LOPR") field(INPC, "YCOR:AS01:322:STDZDIRECT.RVAL") field(INPD, "YCOR:AS01:322:STDZMINIDELTA") field(INPE, "YCOR:AS01:322:IDES") field(PREC, "5") field(FLNK, "YCOR:AS01:322: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, "YCOR:AS01:322:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "YCOR:AS01:322:IDES.HOPR") field(INPB, "YCOR:AS01:322:IDES.LOPR") field(INPC, "YCOR:AS01:322:STDZDIRECT.RVAL") field(INPD, "YCOR:AS01:322:STDZMINIDELTA") field(INPE, "YCOR:AS01:322: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, "YCOR:AS01:322: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, "YCOR:AS01:322:IADJUST.RVAL") field(INPB, "YCOR:AS01:322:STDZDIRECT.RVAL") field(INPC, "YCOR:AS01:322:STDZOK.RVAL") field(INPD, "YCOR:AS01:322:STDZDISABLE.RVAL") field(INPE, "YCOR:AS01:322:STATE.RVAL CPP NMS") field(INPF, "YCOR:AS01:322:ICTRL.RVAL") field(INPG, "YCOR:AS01:322:STATE.SEVR") field(INPH, "YCOR:AS01:322:BDELTAS.M") field(INPI, "YCOR:AS01:322:IACT.SEVR") field(OUT, "YCOR:AS01:322:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "YCOR:AS01:322:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "YCOR:AS01:322:STDZLOSTTOD.PROC") field(LNK2, "YCOR:AS01:322:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "YCOR:AS01:322:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "YCOR:AS01:322:CHECKPWRDIP_ENABLE") field(INPA, "YCOR:AS01:322:IACT CP") field(INPB, "YCOR:AS01:322:STDZIACTMAX") field(EGU, "A") field(FLNK, "YCOR:AS01:322: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, "YCOR:AS01:322:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "YCOR:AS01:322:CHECKPWRDIP_ENABLE") field(INPA, "YCOR:AS01:322:STDZIACTMAX") field(INPB, "YCOR:AS01:322:IACT") field(INPC, "YCOR:AS01:322:IDELTAS.I") field(OUT, "YCOR:AS01:322: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, "YCOR:AS01:322:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "YCOR:AS01:322:STDZOK.RVAL CP") field(INPB, "YCOR:AS01:322:STDZDISABLE.RVAL CP") field(INPC, "YCOR:AS01:322: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, "YCOR:AS01:322: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, "YCOR:AS01:322:CALBOK") { field(DESC, "Successful Calibration") field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "") 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, "YCOR:AS01:322:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "YCOR:AS01:322:CALBOK") field(INPB, "YCOR:AS01:322:CALBDISABLE") field(INPC, "YCOR:AS01:322:CALBSLOPE") field(OOPT, "On Change") field(OUT, "YCOR:AS01:322: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, "YCOR:AS01:322:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "YCOR:AS01:322: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, "YCOR:AS01:322:CALBSLOPE") field(DOL3, "YCOR:AS01:322:CALBOFFSET") field(DOL4, "0") field(DOL5, "0") field(LNK1, "MCOR:AS01:112:VSETPT.DISA PP NMS") field(LNK2, "MCOR:AS01:112:VSETPT.ASLO PP NMS") field(LNK3, "MCOR:AS01:112:VSETPT.AOFF PP NMS") field(LNK4, "MCOR:AS01:112:VSETPT.LINR PP NMS") field(LNK5, "MCOR:AS01:112:VSETPT.DISA PP NMS") # # 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, "MCOR:AS01:112:VSETPT.DISA PP NMS") field(LNK7, "MCOR:AS01:112:VSETPT.ASLO PP NMS") field(LNK8, "MCOR:AS01:112:VSETPT.AOFF PP NMS") field(LNK9, "MCOR:AS01:112:VSETPT.LINR PP NMS") field(LNKA, "MCOR:AS01:112:VSETPT.DISA PP NMS") } record(stringout, "YCOR:AS01:322:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "YCOR:AS01:322: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, "YCOR:AS01:322: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, "YCOR:AS01:322: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, "YCOR:AS01:322:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "YCOR:AS01:322: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, "YCOR:AS01:322:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "MCOR:AS01:112:VSETPT.ESLO") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "YCOR:AS01:322:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "YCOR:AS01:322:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "MCOR:AS01:112:VSETPT.EOFF") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "YCOR:AS01:322: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, "YCOR:AS01:322:CALCDAC") { field(DESC, "IACT to DAC Counts") field(CALC, "D=0?0:(((C*A)+B)-E)/D") field(INPA, "MCOR:AS01:112:I2VSLOPE") field(INPB, "0.0") field(INPC, "YCOR:AS01:322:IACT") field(INPD, "YCOR:AS01:322:DACSLOPE") field(INPE, "YCOR:AS01:322:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "YCOR:AS01:322:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "MCOR:AS01:112:VSETPT.RVAL CP") field(OMSL, "closed_loop") field(PREC, "6") field(PINI, "YES") } record(ao, "YCOR:AS01:322:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "6.0") field(HOPR, "6.0") field(DRVL, "-6.0") field(LOPR, "-6.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "YCOR:AS01:322:CALBIMAX") } record(ao, "YCOR:AS01:322:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "6.0") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVL, "-6.0") field(EGU, "A") field(VAL, "6.0") field(FLNK, "YCOR:AS01:322:CALBSTEPNUM") } record(ao, "YCOR:AS01:322:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(VAL, "0") } record(longout, "YCOR:AS01:322: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, "YCOR:AS01:322:CALBIDELTA") } record(calc, "YCOR:AS01:322:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "YCOR:AS01:322:CALBIMAX") field(INPB, "YCOR:AS01:322:CALBIMIN") field(INPC, "YCOR:AS01:322: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, "YCOR:AS01:322:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "MCOR:AS01:112:ISETPT.DRVH") field(INPB, "MCOR:AS01:112:IACT.HOPR") field(INPC, "YCOR:AS01:322:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "YCOR:AS01:322:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "YCOR:AS01:322:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "YCOR:AS01:322:DACSA") } # Used only for xygraph edm plot record(subArray, "YCOR:AS01:322:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "YCOR:AS01:322: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, "YCOR:AS01:322:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "YCOR:AS01:322:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "YCOR:AS01:322:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "YCOR:AS01:322: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, "YCOR:AS01:322:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "YCOR:AS01:322:CALBYSA") } # Used only for xygraph edm plot record(subArray, "YCOR:AS01:322:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "YCOR:AS01:322:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "YCOR:AS01:322:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "YCOR:AS01:322:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "YCOR:AS01:322:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "YCOR:AS01:322:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "YCOR:AS01:322:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "YCOR:AS01:322: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, "YCOR:AS01:322:CALBSTEPNUM") field(INPB, "YCOR:AS01:322:CALBIACTWF") field(INPC, "YCOR:AS01:322: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, "YCOR:AS01:322: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, "YCOR:AS01:322:STDZITOL") field(INPH, "YCOR:AS01:322:DACSLOPE") field(INPI, "YCOR:AS01:322: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, "YCOR:AS01:322: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, "YCOR:AS01:322:CALBSTEPNUM") field(INPB, "YCOR:AS01:322:CALBIACTWF") field(INPC, "YCOR:AS01:322:DACWF") field(INPF, "YCOR:AS01:322: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 YCOR:AS01:322CALBOK 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, "YCOR:AS01:322:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "YCOR:AS01:322:DEGAUSIMIN.PROC PP") field(OUTB, "YCOR:AS01:322:DEGAUSIMAX.PROC PP") field(OUTC, "YCOR:AS01:322:DEGAUSTYPE.PROC PP") field(OUTD, "YCOR:AS01:322:DEGAUSSTEP.PROC PP") field(OUTE, "YCOR:AS01:322:MADNAME.PROC PP") field(OUTF, "YCOR:AS01:322:PSTYPE.PROC PP") field(OUTG, "YCOR:AS01:322: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, "YCOR:AS01:322:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "YCOR:AS01:322:DEGAUSIMIN NPP NMS") field(INPB, "YCOR:AS01:322:DEGAUSIMAX NPP NMS") field(INPC, "YCOR:AS01:322:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "YCOR:AS01:322:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "YCOR:AS01:322:PSTYPE NPP NMS") field(INPG, "YCOR:AS01:322:DEBUG.RVAL NPP NMS") field(INPH, "YCOR:AS01:322: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, "YCOR:AS01:322:DEGAUSWF PP") field(OUTB, "YCOR:AS01:322:DEGAUSMSG PP") field(OUTC, "YCOR:AS01:322: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, "YCOR:AS01:322:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"YCOR:AS01:322: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, "YCOR:AS01:322: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, "YCOR:AS01:322: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, "YCOR:AS01:322: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, "YCOR:AS01:322: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, "YCOR:AS01:322:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(VAL, "-6.0") } record(ao, "YCOR:AS01:322:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(VAL, "6.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,"YCOR:AS01:322: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, "YCOR:AS01:322: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,"YCOR:AS01:322: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, "YCOR:AS01:322: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, "YCOR:AS01:322: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, "YCOR:AS01:322: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, "YCOR:AS01:322:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "YCOR:AS01:322:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "YCOR:AS01:322:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "YCOR:AS01:322:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "YCOR:AS01:322: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, "YCOR:AS01:322:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "YCOR:AS01:322: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, "YCOR:AS01:322:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "YCOR:AS01:322:DEGAUS_IMAX") field(INPB, "YCOR:AS01:322:ISETPT") field(INPC, "YCOR:AS01:322:DEGAUSTYPE.RVAL") field(OUT, "YCOR:AS01:322:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "YCOR:AS01:322:DEGAUS_IMAX_UPDATE") } record(seq, "YCOR:AS01:322:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "YCOR:AS01:322:ISETPT") field(LNK1, "YCOR:AS01:322:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "YCOR:AS01:322:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(VAL, "6.0") field(FLNK, "YCOR:AS01:322:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "YCOR:AS01:322:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "YCOR:AS01:322:DEGAUS_IMAX") field(FLNK, "YCOR:AS01:322:DEGAUS_IMAXPOL") } record(bo, "YCOR:AS01:322:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "YCOR:AS01:322:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "YCOR:AS01:322: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, "YCOR:AS01:322:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "YCOR:AS01:322:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "6.0") field(LOPR, "-6.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "YCOR:AS01:322:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "YCOR:AS01:322:IACT") field(INPB, "YCOR:AS01:322:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "YCOR:AS01:322:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "YCOR:AS01:322:IACTPOL") } record(bo, "YCOR:AS01:322: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,"YCOR:AS01:322: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, "YCOR:AS01:322:DEGAUSENABLE CP") field(INPB, "YCOR:AS01:322:DEGAUSOK") field(INPC, "YCOR:AS01:322:STATE CP") field(INPD, "YCOR:AS01:322:STATE.SEVR") field(OUT, "YCOR:AS01:322:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "YCOR:AS01:322:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "YCOR:AS01:322:DEGAUS_STATE_CHECK") field(LNK1, "YCOR:AS01:322:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "YCOR:AS01:322:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "YCOR:AS01:322:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "YCOR:AS01:322: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, "YCOR:AS01:322:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "YCOR:AS01:322:DEGAUSOK.ZSV") field(LNK2, "YCOR:AS01:322: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, "YCOR:AS01:322:STATMSG.FRSV") field(LNK4, "YCOR:AS01:322: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, "YCOR:AS01:322:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "YCOR:AS01:322:DEGAUSOK.ZSV") field(LNK2, "YCOR:AS01:322: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, "YCOR:AS01:322:STATMSG.FRSV") field(LNK4, "YCOR:AS01:322: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, "YCOR:AS01:322:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "YCOR:AS01:322: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, "YCOR:AS01:322:STATMSG.FRSV") field(LNK3, "YCOR:AS01:322: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, "YCOR:AS01:322:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "YCOR:AS01:322: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, "YCOR:AS01:322:STATMSG.FRSV PP") field(LNK3, "YCOR:AS01:322:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "YCOR:AS01:322:FUNC") { field(DESC, "YCOR:AS01:322 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, "0") field(NIVL, "0") field(TEVL, "0") field(ELVL, "5") field(TVVL, "6") field(TTVL, "7") field(FTVL, "4") field(FFVL, "3") field(OUT, "YCOR:AS01:322:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "YCOR:AS01:322:CTRL") { field(DESC, "YCOR:AS01:322 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, "") field(TVST, "") field(TTST, "") 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, "0") field(TVVL, "0") field(TTVL, "0") field(FTVL, "0") field(FFVL, "0") field(OUT, "YCOR:AS01:322:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "YCOR:AS01:322:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "YCOR:AS01:322:BUSY") } # Set to FREE on IOC reboot record(bo, "YCOR:AS01:322:BUSY") { field(DESC, "YCOR:AS01:322 Ctrl Done") field(DOL, "YCOR:AS01:322:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "YCOR:AS01:322:SELECT") } record(bo, "YCOR:AS01:322:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "YCOR:AS01:322: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, "YCOR:AS01:322:CTRLSTATE") { field(DESC, "YCOR:AS01:322 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("YCOR:AS01:322:CTRL",20,20,0,0,"YCOR:AS01:322:CTRL") #! Field("YCOR:AS01:322:CTRL.OUT",16777215,1,"YCOR:AS01:322:CTRL.OUT") #! Link("YCOR:AS01:322:CTRL.OUT","YCOR:AS01:322:SELECTEN.A") #! Field("YCOR:AS01:322:CTRL.VAL",16777215,1,"YCOR:AS01:322:CTRL.VAL") #! Record("YCOR:AS01:322:SELECTEN",321,381,0,0,"YCOR:AS01:322:SELECTEN") #! Field("YCOR:AS01:322:SELECTEN.A",16777215,0,"YCOR:AS01:322:SELECTEN.A") #! Field("YCOR:AS01:322:SELECTEN.FLNK",16777215,1,"YCOR:AS01:322:SELECTEN.FLNK") #! Link("YCOR:AS01:322:SELECTEN.FLNK","YCOR:AS01:322:BUSY") #! Field("YCOR:AS01:322:SELECTEN.VAL",16777215,1,"YCOR:AS01:322:SELECTEN.VAL") #! Record("YCOR:AS01:322:BUSY",623,274,0,0,"YCOR:AS01:322:BUSY") #! Field("YCOR:AS01:322:BUSY.DOL",16777215,0,"YCOR:AS01:322:BUSY.DOL") #! Link("YCOR:AS01:322:BUSY.DOL","YCOR:AS01:322:SELECTEN.VAL") #! Field("YCOR:AS01:322:BUSY.FLNK",16777215,1,"YCOR:AS01:322:BUSY.FLNK") #! Link("YCOR:AS01:322:BUSY.FLNK","YCOR:AS01:322:SELECT") #! Record("YCOR:AS01:322:SELECT",669,508,0,1,"YCOR:AS01:322:SELECT") #! Record("YCOR:AS01:322:FUNC",940,120,0,0,"YCOR:AS01:322:FUNC") #! Field("YCOR:AS01:322:FUNC.OUT",16777215,0,"YCOR:AS01:322:FUNC.OUT") #! Link("YCOR:AS01:322:FUNC.OUT","YCOR:AS01:322:CTRL.VAL") #! Record("YCOR:AS01:322:ABORT",193,41,0,0,"YCOR:AS01:322:ABORT") #! Record("YCOR:AS01:322:CTRLSTATE",369,34,0,0,"YCOR:AS01:322: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,"YCOR:AS01:322:SELECT is used for Multi-device selection.\nIt is enabled when associated YCOR:AS01:322:CTRL is \"0\" (DONE).\nIt is disabled when associated YCOR:AS01:322: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,"YCOR:AS01:322: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, "YCOR:AS01:322:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "YCOR:AS01:322:BCTRL.SEVR") field(OUT, "YCOR:AS01:322: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, "YCOR:AS01:322:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "YCOR:AS01:322:BACT") field(INPB, "YCOR:AS01:322:POLYCOEF") field(INPC, "YCOR:AS01:322:POLYCOEF.A") field(INPD, "YCOR:AS01:322:POLYCOEF.B") field(INPE, "YCOR:AS01:322:IACT MS") field(INPF, "YCOR:AS01:322:BDELTAS PP") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "110.0") field(LOPR, "-110.0") field(HIHI, "110.0") field(LOLO, "-110.0") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "110.0") field(LOW, "-110.0") field(FLNK, "YCOR:AS01:322: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, "YCOR:AS01:322: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, "YCOR:AS01:322:BDES") field(INPB, "YCOR:AS01:322:TRIMBTOL") field(INPC, "YCOR:AS01:322:TRIMBTOLR") field(INPD, "YCOR:AS01:322:CHCKBTOL") field(INPE, "YCOR:AS01:322:CHCKBTOLR") field(F, "0.0") field(INPG, "30") field(INPH, "YCOR:AS01:322:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "YCOR:AS01:322:MPSBTOL") field(INPQ, "YCOR:AS01:322:MPSBTOLR") field(FLNK, "YCOR:AS01:322:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "YCOR:AS01:322:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "YCOR:AS01:322:BDES") field(INPB, "YCOR:AS01:322:BDELTAS.I") field(INPG, "YCOR:AS01:322:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "YCOR:AS01:322:BCON.HIGH") field(OUTB, "YCOR:AS01:322:BCON.LOW") field(OUTC, "YCOR:AS01:322:BCON.HIHI") field(OUTD, "YCOR:AS01:322:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "YCOR:AS01:322:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "YCOR:AS01:322:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "YCOR:AS01:322:BDIFF") field(LNK2, "YCOR:AS01:322:BADIFF") field(LNK3, "YCOR:AS01:322:BRATIO") field(LNK4, "YCOR:AS01:322:MPSLIMITS") field(LNK5, "YCOR:AS01:322:I2BSTATUS") field(LNK6, "YCOR:AS01:322:IACTFO.PROC") } record(calc, "YCOR:AS01:322:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "YCOR:AS01:322:BDES") field(INPB, "YCOR:AS01:322:BACT") field(EGU, "kG-m") field(PREC, "7") } record(calc, "YCOR:AS01:322:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "YCOR:AS01:322:BDIFF") field(EGU, "kG-m") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "YCOR:AS01:322:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "YCOR:AS01:322:BDIFF") field(INPB, "YCOR:AS01:322:BDES.HOPR") field(EGU, "kG-m") field(PREC, "7") } record(mbbi, "YCOR:AS01:322: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, "YCOR:AS01:322:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "YCOR:AS01:322:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "YCOR:AS01:322:BMON") field(INPB, "YCOR:AS01:322:POLYCOEF") field(INPC, "YCOR:AS01:322:POLYCOEF.A") field(INPD, "YCOR:AS01:322:POLYCOEF.B") field(INPE, "YCOR:AS01:322:IMON MS") field(INPF, "YCOR:AS01:322:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "110.0") field(LOPR, "-110.0") field(HIHI, "110.0") field(LOLO, "-110.0") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "110.0") field(LOW, "-110.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=MCOR:AS01:112:BDES CP record(ao, "YCOR:AS01:322:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "110.0") field(DRVL, "-110.0") field(HOPR, "110.0") field(LOPR, "-110.0") field(PREC, "7") field(EGU, "kG-m") field(MDEL, "-1") field(OMSL, "supervisory") # field(DOL, "") field(OUT, "YCOR:AS01:322:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "YCOR:AS01:322:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "YCOR:AS01:322:POLYCOEF") field(INPC, "YCOR:AS01:322:POLYCOEF.A") field(INPD, "YCOR:AS01:322:POLYCOEF.B") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "110.0") field(LOPR, "-110.0") field(MDEL, "-1") field(INPE, "YCOR:AS01:322:BDES.DRVH") field(INPF, "YCOR:AS01:322:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "YCOR:AS01:322:IDES") } record(sub, "YCOR:AS01:322:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "YCOR:AS01:322:POLYCOEF") field(INPC, "YCOR:AS01:322:POLYCOEF.A") field(INPD, "YCOR:AS01:322:POLYCOEF.B") field(INPE, "YCOR:AS01:322:BDES.DRVH") field(INPF, "YCOR:AS01:322:BDES.DRVL") field(EGU, "kG-m") field(HOPR, "110.0") field(LOPR, "-110.0") field(PREC, "7") field(VAL, "0.0") field(FLNK, "YCOR:AS01:322:INOM") } record(sub, "YCOR:AS01:322:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "YCOR:AS01:322:BDES.VAL") field(INPB, "YCOR:AS01:322:BDES.DRVH") field(INPC, "YCOR:AS01:322:BDES.DRVL") field(INPD, "YCOR:AS01:322:BDELTAS.I") field(INPE, "YCOR:AS01:322:BDELTAS.J") field(INPG, "YCOR:AS01:322:STATE") field(INPH, "YCOR:AS01:322:HSTA") field(EGU, "kG-m") field(HOPR, "110.0") field(LOPR, "-110.0") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "YCOR:AS01:322:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "YCOR:AS01:322:BDES.VAL") field(INPB, "YCOR:AS01:322:BDES.DRVH") field(INPC, "YCOR:AS01:322:BDES.DRVL") field(INPD, "YCOR:AS01:322:BDELTAS.K") field(INPE, "YCOR:AS01:322:BDELTAS.L") field(INPG, "YCOR:AS01:322:STATE") field(INPH, "YCOR:AS01:322:HSTA") field(EGU, "kG-m") field(HOPR, "110.0") field(LOPR, "-110.0") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "YCOR:AS01:322:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "YCOR:AS01:322:BLIMITS") field(LNK1, "YCOR:AS01:322:BACTLIMITS.F PP") field(DOL2, "YCOR:AS01:322:BACTLIMITS.I") field(LNK2, "YCOR:AS01:322:BACT.HIGH") field(DOL3, "YCOR:AS01:322:BACTLIMITS.J") field(LNK3, "YCOR:AS01:322:BACT.LOW") field(DOL4, "YCOR:AS01:322:BACTLIMITS.K") field(LNK4, "YCOR:AS01:322:BACT.HIHI") field(DOL5, "YCOR:AS01:322:BACTLIMITS.L") field(LNK5, "YCOR:AS01:322:BACT.LOLO") field(DOL6, "YCOR:AS01:322:BLIMITS") field(LNK6, "YCOR:AS01:322:BMONLIMITS.F PP") field(DOL7, "YCOR:AS01:322:BMONLIMITS.I") field(LNK7, "YCOR:AS01:322:BMON.HIGH") field(DOL8, "YCOR:AS01:322:BMONLIMITS.J") field(LNK8, "YCOR:AS01:322:BMON.LOW") field(DOL9, "YCOR:AS01:322:BMONLIMITS.K") field(LNK9, "YCOR:AS01:322:BMON.HIHI") field(DOLA, "YCOR:AS01:322:BMONLIMITS.L") field(LNKA, "YCOR:AS01:322:BMON.LOLO") field(FLNK, "YCOR:AS01:322:ILIMITS") field(SCAN, "5 second") } record(ao, "YCOR:AS01:322:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG-m") field(DRVH, "110.0") field(DRVL, "-110.0") field(HOPR, "110.0") field(LOPR, "-110.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, "YCOR:AS01:322: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, "YCOR:AS01:322:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "YCOR:AS01:322:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "YCOR:AS01:322:BCTRL.VAL") field(LNK2, "YCOR:AS01:322:BDES PP") field(DOL3, "1") field(LNK3, "YCOR:AS01:322:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "YCOR:AS01:322:CHECKSTDZLOST.PROC PP") field(DOL5, "YCOR:AS01:322:BCTRL.VAL") field(LNK5, "YCOR:AS01:322:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "YCOR:AS01:322:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "YCOR:AS01:322:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "YCOR:AS01:322:POLYCOEF") field(INPC, "YCOR:AS01:322:POLYCOEF.A") field(INPD, "YCOR:AS01:322:POLYCOEF.B") field(INPE, "YCOR:AS01:322:BDES.DRVH") field(INPF, "YCOR:AS01:322:BDES.DRVL") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "110.0") field(LOPR, "-110.0") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "YCOR:AS01:322:ISETPT") } record(ao, "YCOR:AS01:322:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "110.0") field(DRVL, "-110.0") field(EGU, "kG-m") field(HOPR, "110.0") field(LOPR, "-110.0") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "YCOR:AS01:322:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "YC02S") } record(ai, "YCOR:AS01:322: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, "2019.850") } record(ao, "YCOR:AS01:322:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "110.0") field(DRVL, "-110.0") field(EGU, "kG-m") field(HOPR, "110.0") field(LOPR, "-110.0") field(PREC, "7") field(PINI, "YES") field(VAL, "110.0") field(FLNK, "YCOR:AS01:322:BSTEP") } record(ao, "YCOR:AS01:322:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "110.0") field(DRVL, "-110.0") field(EGU, "kG-m") field(HOPR, "110.0") field(LOPR, "-110.0") field(PREC, "7") field(PINI, "YES") field(VAL, "-110.0") field(FLNK, "YCOR:AS01:322:BSTEP") } record(ao, "YCOR:AS01:322:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "110.0") field(DRVL, "-110.0") field(EGU, "kG-m") field(HOPR, "110.0") field(LOPR, "-110.0") field(PINI, "YES") field(PREC, "7") } # This record is processed by YCOR:AS01:322: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, "YCOR:AS01:322:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "110.0") field(LOPR, "-110.0") field(DRVH, "110.0") field(DRVL, "-110.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, "YCOR:AS01:322:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "YCOR:AS01:322:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "YCOR:AS01:322:POLYCOEF") field(INPC, "YCOR:AS01:322:POLYCOEF.A") field(INPD, "YCOR:AS01:322:POLYCOEF.B") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "110.0") field(LOPR, "-110.0") field(MDEL, "-1") field(INPE, "YCOR:AS01:322:BCON.DRVH") field(INPF, "YCOR:AS01:322:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "YCOR:AS01:322: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, "YCOR:AS01:322:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "YCOR:AS01:322:BMAX") field(INPB, "YCOR:AS01:322:BMIN") field(INPC, "YCOR:AS01:322:BMIN.SEVR") field(INPD, "YCOR:AS01:322: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,"YCOR:AS01:322:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "YCOR:AS01:322:ONLINE CP") field(OUT, "YCOR:AS01:322:BCTRLDISABLEFOUT PP") } record(fanout, "YCOR:AS01:322:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "YCOR:AS01:322:BCTRLDISABLECALC") field(LNK1, "YCOR:AS01:322:BCTRLDISABLE") field(LNK2, "YCOR:AS01:322:BCTRLENABLE") } record(stringout, "YCOR:AS01:322:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "YCOR:AS01:322:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "YCOR:AS01:322:BCTRLDISV_UPDATE") } record(stringout, "YCOR:AS01:322:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "YCOR:AS01:322:BCTRL.ASG") field(VAL, "") field(FLNK, "YCOR:AS01:322:BCTRLDISV_UPDATE") } record(calcout, "YCOR:AS01:322:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "YCOR:AS01:322:ONLINE") field(OUT, "YCOR:AS01:322: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,"YCOR:AS01:322:BACT and MON\n are processed via links from \n YCOR:AS01:322:IACT (device raw value readback 1)\n and\n YCOR:AS01:322: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 YCOR:AS01:322:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = YCOR:AS01:322: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,"YCOR:AS01:322:BDES\n is processed when set by CA users or \n YCOR:AS01:322: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,"YCOR:AS01:322: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 YCOR:AS01:322: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 (YCOR:AS01:322: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,"YCOR:AS01:322:B*LIMITS and YCOR:AS01:322:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from YCOR:AS01:322: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,"YCOR:AS01:322: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,"YCOR:AS01:322: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, "YCOR:AS01:322: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, "YCOR:AS01:322:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG-m") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "YCOR:AS01:322:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "YCOR:AS01:322:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "110.0") field(DRVL, "-110.0") field(PINI, "YES") field(VAL, "110.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "YCOR:AS01:322:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "110.0") field(DRVL, "-110.0") field(PINI, "YES") field(VAL, "-110.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "YCOR:AS01:322:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "110.0") field(DRVL, "-110.0") field(PINI, "YES") field(VAL, "-110.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "YCOR:AS01:322:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "110.0") field(DRVL, "-110.0") field(PINI, "YES") field(VAL, "-110.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "YCOR:AS01:322: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, "YCOR:AS01:322:MPSLIMITS.E PP") } record(aSub, "YCOR:AS01:322: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, "YCOR:AS01:322:MPS.RVAL") field(INPB, "YCOR:AS01:322:BADIFF") field(INPC, "YCOR:AS01:322:BDELTAS.N") field(INPD, "YCOR:AS01:322:BACT") field(INPE, "YCOR:AS01:322:MPSBITMASK.RVAL") field(INPF, "YCOR:AS01:322:MPSBLLIM") field(INPG, "YCOR:AS01:322:MPSBMIN") field(INPH, "YCOR:AS01:322:MPSBMAX") field(INPI, "YCOR:AS01:322: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, "YCOR:AS01:322:INTOL.RVAL PP") field(OUTB, "YCOR:AS01:322:INTOL_BMIN.RVAL PP") field(OUTC, "YCOR:AS01:322:INTOL_BRANGE.RVAL PP") field(OUTD, "YCOR:AS01:322: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, "YCOR:AS01:322:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "YCOR:AS01:322:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "YCOR:AS01:322:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "YCOR:AS01:322:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "YCOR:AS01:322:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "YCOR:AS01:322:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "YCOR:AS01:322:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "YCOR:AS01:322: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, "YCOR:AS01:322:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "YCOR:AS01:322:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "YCOR:AS01:322:CHCKBTOL") field(INPB, "YCOR:AS01:322:POLYCOEF.B") field(PREC, "9") } record(calc, "YCOR:AS01:322: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, "YCOR:AS01:322:CHCKBTOL") field(FLNK, "YCOR:AS01:322:CHCKITOL") } record(calc, "YCOR:AS01:322:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "YCOR:AS01:322:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "YCOR:AS01:322:BDES.HOPR") field(INPB, "YCOR:AS01:322:STABILITY") field(INPC, "YCOR:AS01:322:BDES.LOPR") } record(longout, "YCOR:AS01:322:STABILITY") { field(DESC, "Long Term Stability") field(PINI, "YES") field(VAL, "1000") field(EGU, "ppm") field(DRVH, "3000") field(DRVL, "100") field(HOPR, "3000") field(LOPR, "100") field(FLNK, "YCOR:AS01:322:CHCKBTOL") } record(calc, "YCOR:AS01:322:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG-m") field(CALC, "ABS(A*B)") field(INPA, "YCOR:AS01:322:POLYCOEF.B") field(INPB, "YCOR:AS01:322:TRIMBTOL") field(PREC, "9") } record(ai, "YCOR:AS01:322:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "YCOR:AS01:322: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, "YCOR:AS01:322:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "YCOR:AS01:322:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "YCOR:AS01:322:PAUGO") } record(fanout, "YCOR:AS01:322:PAUGO") { field(DESC, "PAU control") field(LNK1, "YCOR:AS01:322:PAUSTOP") field(LNK2, "YCOR:AS01:322: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, "YCOR:AS01:322:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "YCOR:AS01:322:PAU.RVAL") field(DISV, "0") field(DOL1, "0") field(DOL2, "0") field(DOL3, "1") field(DLY3, "1") # field(LNK1, "MCOR:AS01:112:ISETPT.DISV") # field(LNK2, "MCOR:AS01:112:VSETPT.DISV") # field(LNK3, "ACTPAU PP") } record(seq, "YCOR:AS01:322:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "YCOR:AS01:322:PAU.RVAL") field(DISV, "1") field(DOL1, "1") field(DOL2, "1") field(DOL3, "0") # field(LNK1, "MCOR:AS01:112:ISETPT.DISV") # field(LNK2, "MCOR:AS01:112:VSETPT.DISV") # field(LNK3, "ACTPAU PP") } # Change attribute to PSDEVNAME record(stringout, "YCOR:AS01:322:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "MCOR:AS01:112:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "YCOR:AS01:322: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, "YCOR:AS01:322:PSTYPE.RVAL") field(INPC, "YCOR:AS01:322:TURNEDOFF.RVAL") field(INPD, "YCOR:AS01:322:CONFIG.RVAL") field(INPE, "YCOR:AS01:322:PSCATEGORY.RVAL") field(INPF, "YCOR:AS01:322:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "YCOR:AS01:322:AUTOCTRL.RVAL") field(INPJ, "YCOR:AS01:322:OUTOFSERVICE.RVAL") field(INPL, "YCOR:AS01:322:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "YCOR:AS01:322:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "YCOR:AS01:322:PAU") field(INPP, "YCOR:AS01:322:CALBDISABLE.RVAL") field(INPQ, "YCOR:AS01:322:PTRBDISABLE.RVAL") field(INPR, "YCOR:AS01:322:TRIMDISABLE.RVAL") field(INPS, "YCOR:AS01:322:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "YCOR:AS01:322:FBCK") field(INPU, "YCOR:AS01:322:TRIMTYPE.RVAL") field(INPV, "YCOR:AS01:322:STDZDIRECT.RVAL") field(INPW, "YCOR:AS01:322:DEGAUSENABLE.RVAL") field(FLNK, "YCOR:AS01:322:HSTA") } record(longin, "YCOR:AS01:322:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "YCOR:AS01:322:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "YCOR:AS01:322: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, "YCOR:AS01:322: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, "YCOR:AS01:322: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, "YCOR:AS01:322: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, "YCOR:AS01:322: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, "YCOR:AS01:322: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 YCOR:AS01:322:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses YCOR:AS01:322:FBCK. # This PV should be replaced by YCOR:AS01:322: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, "YCOR:AS01:322: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, "YCOR:AS01:322: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, "YCOR:AS01:322: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, "YCOR:AS01:322:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"YCOR:AS01:322:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "YCOR:AS01:322:OUTOFSERVICE NPP NMS") field(OUT, "YCOR:AS01:322:ONLINE PP") } record(bo, "YCOR:AS01:322:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "YCOR:AS01:322: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, "YCOR:AS01:322: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, "YCOR:AS01:322: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, "YCOR:AS01:322: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, "YCOR:AS01:322: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, "YCOR:AS01:322: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, "YCOR:AS01:322: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, "YCOR:AS01:322: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, "YCOR:AS01:322: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, "0") field(ASG, "NOWRITE") } record(mbbo, "YCOR:AS01:322: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, "0") field(ASG, "NOWRITE") } record(mbbo, "YCOR:AS01:322: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, "YCOR:AS01:322:TRIMTYPE") } record(stringout, "YCOR:AS01:322:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "YCOR:AS01:322:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "YCOR:AS01:322:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "YCOR:AS01:322:STATE.RVAL") field(INPB, "YCOR:AS01:322:INTLKSUMY.RVAL") field(OUT, "YCOR:AS01:322:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "YCOR:AS01:322: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, "YCOR:AS01:322:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "YCOR:AS01:322:STATE.RVAL") field(INPB, "YCOR:AS01:322:INTLKSUMY.RVAL") field(OUT, "YCOR:AS01:322:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "YCOR:AS01:322:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "YCOR:AS01:322:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "YCOR:AS01:322: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, "YCOR:AS01:322: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, "YCOR:AS01:322: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, "YCOR:AS01:322: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,"YCOR:AS01:322: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("YCOR:AS01:322:TURNEDOFF",3140,1907,0,1,"YCOR:AS01:322:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "YCOR:AS01:322:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "YCOR:AS01:322:BACT.STAT") field(INPB, "YCOR:AS01:322:BDES.STAT") field(INPC, "YCOR:AS01:322:IRIPL.STAT") field(INPD, "MCOR:AS01:112:VSETPT.STAT") field(INPE, "MCOR:AS01:112:VACT.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, "YCOR:AS01:322:BACT.SEVR") field(INPH, "YCOR:AS01:322:BDES.SEVR") field(INPI, "YCOR:AS01:322:IRIPL.SEVR") field(INPJ, "MCOR:AS01:112:VSETPT.SEVR") field(INPK, "MCOR:AS01:112:VACT.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, "YCOR:AS01:322:STATE.RVAL") field(INPN, "YCOR:AS01:322:STDZOK") field(INPO, "YCOR:AS01:322:CALBOK") field(INPP, "YCOR:AS01:322:OUTOFSERVICE.RVAL") field(INPQ, "YCOR:AS01:322:CONFIG.RVAL") field(INPR, "YCOR:AS01:322:HSTA") field(INPS, "YCOR:AS01:322:CTRL.RVAL") field(INPT, "YCOR:AS01:322:DEGAUSOK") field(INPV, "YCOR:AS01:322: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, "YCOR:AS01:322:STAT") } record(longout, "YCOR:AS01:322:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "YCOR:AS01:322:STATCTRLSUB") field(DOL, "YCOR:AS01:322:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "YCOR:AS01:322:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "YCOR:AS01:322:STAT") field(INPB, "YCOR:AS01:322:HSTA") field(INPD, "YCOR:AS01:322:ONOFFCTRL.RVAL") field(FLNK, "YCOR:AS01:322:STATMSG") } record(mbbo, "YCOR:AS01:322: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, "YCOR:AS01:322:UNAVAILGO") field(DOL, "YCOR:AS01:322:STATCTRLSUB.W") } record(seq, "YCOR:AS01:322:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "YCOR:AS01:322:STATSUB.U") field(LNK1, "YCOR:AS01:322:UNAVAIL PP") } record(stringout, "YCOR:AS01:322:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"YCOR:AS01:322:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - YCOR:AS01:322:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - YCOR:AS01:322: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,"YCOR:AS01:322STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - YCOR:AS01:322:STATUS\nC - YCOR:AS01:322:ON\nD - YCOR:AS01:322:STDZOK\nE - YCOR:AS01:322:CALBOK\nF - YCOR:AS01:322:BACTDRIFT (future)\nG -\nH- YCOR:AS01:322:DACSTATUS\nI -YCOR:AS01:322:ADCSTATUS\nJ - YCOR:AS01:322:BACTSTATUS\nK - YCOR:AS01:322:BDESSTATUS\nL - YCOR:AS01:322:RIPLSTATUS\n\nOutput:\nP - YCOR:AS01:322: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, "YCOR:AS01:322: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, "YCOR:AS01:322: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, "YCOR:AS01:322: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, "YCOR:AS01:322: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 # Note: for slave with trim coils # set the macro ACT to the following: # ACT=:IACTCALC record(ai, "XCOR:AS01:341:IACT") { field(DESC, "Current") field(INP, "MCOR:AS01:109:IACT") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "XCOR:AS01:341:BACT") info(autosaveFields,"HYST") } record(bi, "XCOR:AS01:341:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "MCOR:AS01:109:STATE NPP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "XCOR:AS01:341:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "6.0") field(LOLO, "-6.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "XCOR:AS01:341:BDELTAS") field(DRVH, "6.0") field(DRVL, "-6.0") field(DOL, "XCOR:AS01:341: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, "XCOR:AS01:341:ICTRL PP") } # This record is processed by XCOR:AS01:341:ICON") # Note: we are not setting alarms here. record(ao, "XCOR:AS01:341:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(DOL, "XCOR:AS01:341:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "XCOR:AS01:341:INOM") { field(DESC, "Nominal Current") field(DOL, "XCOR:AS01:341:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "6.0") field(DRVL, "-6.0") field(HOPR, "6.0") field(LOPR, "-6.0") } record(ao, "XCOR:AS01:341:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(MDEL, "-1") field(FLNK, "XCOR:AS01:341:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "XCOR:AS01:341:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "XCOR:AS01:341:ISETPT.OMSL") field(DOL2, "XCOR:AS01:341:ICTRL") field(LNK2, "XCOR:AS01:341:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "XCOR:AS01:341:ISETPT.OMSL") } record(ao, "XCOR:AS01:341:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "6.0") field(DRVL, "-6.0") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(PINI, "YES") field(VAL, "6.0") field(FLNK, "XCOR:AS01:341:IMIN") } record(ao, "XCOR:AS01:341:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "6.0") field(DRVL, "-6.0") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(VAL, "-6.0") field(FLNK, "XCOR:AS01:341:IRANGE") } record(sel, "XCOR:AS01:341:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(NVL, "XCOR:AS01:341:BACT.SEVR") field(INPA, "XCOR:AS01:341:IACT NPP MS") field(INPB, "XCOR:AS01:341:IACTPREVOK NPP MS") field(INPC, "XCOR:AS01:341:IACTPREVOK NPP MS") field(INPD, "XCOR:AS01:341:IACTPREVOK NPP MS") } record(sub, "XCOR:AS01:341:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "XCOR:AS01:341:IDES") field(INPB, "XCOR:AS01:341:ISETPT.DRVH") field(INPC, "XCOR:AS01:341:ISETPT.DRVL") field(INPD, "XCOR:AS01:341:IDELTAS.I") field(INPE, "XCOR:AS01:341:IDELTAS.J") field(INPG, "XCOR:AS01:341:STATE") field(INPH, "XCOR:AS01:341:HSTA") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "XCOR:AS01:341:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "XCOR:AS01:341:IDES") field(INPB, "XCOR:AS01:341:ISETPT.DRVH") field(INPC, "XCOR:AS01:341:ISETPT.DRVL") field(INPD, "XCOR:AS01:341:IDELTAS.K") field(INPE, "XCOR:AS01:341:IDELTAS.L") field(INPG, "XCOR:AS01:341:STATE") field(INPH, "XCOR:AS01:341:HSTA") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "XCOR:AS01:341:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "XCOR:AS01:341:BLIMITS") field(LNK1, "XCOR:AS01:341:IACTLIMITS.F PP") field(DOL2, "XCOR:AS01:341:IACTLIMITS.I") field(LNK2, "XCOR:AS01:341:IACT.HIGH") field(DOL3, "XCOR:AS01:341:IACTLIMITS.J") field(LNK3, "XCOR:AS01:341:IACT.LOW") field(DOL4, "XCOR:AS01:341:IACTLIMITS.K") field(LNK4, "XCOR:AS01:341:IACT.HIHI") field(DOL5, "XCOR:AS01:341:IACTLIMITS.L") field(LNK5, "XCOR:AS01:341:IACT.LOLO") field(DOL6, "XCOR:AS01:341:BLIMITS") field(LNK6, "XCOR:AS01:341:IMONLIMITS.F PP") field(DOL7, "XCOR:AS01:341:IMONLIMITS.I") field(LNK7, "XCOR:AS01:341:IMON.HIGH") field(DOL8, "XCOR:AS01:341:IMONLIMITS.J") field(LNK8, "XCOR:AS01:341:IMON.LOW") field(DOL9, "XCOR:AS01:341:IMONLIMITS.K") field(LNK9, "XCOR:AS01:341:IMON.HIHI") field(DOLA, "XCOR:AS01:341:IMONLIMITS.L") field(LNKA, "XCOR:AS01:341: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, "XCOR:AS01:341:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "XCOR:AS01:341:TRIMBTOL") field(INPE, "XCOR:AS01:341:CHCKBTOL") field(INPF, "XCOR:AS01:341:BDELTAS.K") field(INPG, "XCOR:AS01:341:BDELTAS.L") field(INPH, "XCOR:AS01:341: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, "XCOR:AS01:341:STDZITOLR") field(INPC, "XCOR:AS01:341:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = MCOR:AS01:109: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, "XCOR:AS01:341: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 = MCOR:AS01:109:RESET PP # record(bo, "XCOR:AS01:341:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "MCOR:AS01:109:RESET PP") } record(bo, "XCOR:AS01:341:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "") 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, "XCOR:AS01:341: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, "XCOR:AS01:341:TRIMRAMPRATE") field(OUT, "") field(FLNK, "XCOR:AS01:341:STDZDLY") } record(ao, "XCOR:AS01:341:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(MDEL, "-1") field(OUT, "MCOR:AS01:109:ISETPT PP") field(DOL, "XCOR:AS01:341: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, "XCOR:AS01:341:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "XCOR:AS01:341:BMON") } record(ao, "XCOR:AS01:341:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "XCOR:AS01:341:IRIPLOK") } record(sub, "XCOR:AS01:341:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "XCOR:AS01:341:IRIPL.VAL") field(INPB, "XCOR:AS01:341: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, "XCOR:AS01:341: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, "XCOR:AS01:341:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") } record(bi, "XCOR:AS01:341:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "MCOR:AS01:109:INTLKSUMY NPP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "XCOR:AS01:341: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, "MCOR:AS01:109:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "XCOR:AS01:341:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "XCOR:AS01:341:IACTPREVOK") field(LNK2, "XCOR:AS01:341:IDIFF") field(LNK3, "XCOR:AS01:341:IADIFF") field(LNK4, "XCOR:AS01:341:IRATIO") field(LNK5, "XCOR:AS01:341:IDIRECT") field(LNK6, "XCOR:AS01:341:IACTPOL_CHECK") } record(calc, "XCOR:AS01:341:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "XCOR:AS01:341:IDES") field(INPB, "XCOR:AS01:341:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "6.0") field(LOPR, "-6.0") } record(calc, "XCOR:AS01:341:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "XCOR:AS01:341:IDIFF") field(PREC, "9") } record(calc, "XCOR:AS01:341:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "XCOR:AS01:341:IDIFF") field(INPB, "XCOR:AS01:341:IDES.DRVH") field(PREC, "9") } record(calcout, "XCOR:AS01:341:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "XCOR:AS01:341:IMIN") field(INPB, "XCOR:AS01:341: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, "XCOR:AS01:341: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, "XCOR:AS01:341:IACT") field(FLNK, "XCOR:AS01:341:IACTPOL") } record(bo, "XCOR:AS01:341:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "XCOR:AS01:341: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,"XCOR:AS01:341:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from XCOR:AS01:341:IDELTAS and the\n XCOR:AS01:341: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,"XCOR:AS01:341:IACT: \n Get copy of XCOR:AS01:341:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"XCOR:AS01:341: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,"XCOR:AS01:341:IDES:\n Contains raw value calculated by \nXCOR:AS01:341: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 \nXCOR:AS01:341:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"XCOR:AS01:341: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 XCOR:AS01:341: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 XCOR:AS01:341: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,"XCOR:AS01:341:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by XCOR:AS01:341:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, XCOR:AS01:341:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n XCOR:AS01:341: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, "XCOR:AS01:341:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "XCOR:AS01:341:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "XCOR:AS01:341:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "XCOR:AS01:341:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "XCOR:AS01:341:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "XCOR:AS01:341:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "0") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "XCOR:AS01:341: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, "XCOR:AS01:341:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "XCOR:AS01:341:TRIMTYPE.RVAL") field(INPB, "XCOR:AS01:341:CONFIG.RVAL") field(OUT, "XCOR:AS01:341:TRIMMAXNUM PP") } record(longout, "XCOR:AS01:341: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, "XCOR:AS01:341: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, "closed_loop") field(VAL, "1") field(OUT, "XCOR:AS01:341:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "XCOR:AS01:341: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, "closed_loop") field(VAL, "10") } record(bo, "XCOR:AS01:341: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, "XCOR:AS01:341: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, "XCOR:AS01:341:TRIMSTEPMIN") { field(DESC, "Min step in current") field(DTYP, "Soft Channel") field(DOL, "MCOR:AS01:109:ISTEP") field(PREC, "7") field(EGUF, "10") field(EGUL, "0") field(EGU, "A") field(HOPR, "10") field(LOPR, "0") field(VAL, "0.0001") } record(bo, "XCOR:AS01:341:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "1") } record(ao, "XCOR:AS01:341: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, "XCOR:AS01:341:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "XCOR:AS01:341: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, "XCOR:AS01:341: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, "XCOR:AS01:341:IMOVE") field(INPB, "XCOR:AS01:341:IACT") field(INPC, "XCOR:AS01:341:IRAMPRATE") field(INPD, "1.0") field(INPE, "XCOR:AS01:341:TRIMDLYPCT") field(INPF, "XCOR:AS01:341:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "XCOR:AS01:341:RAMPTIME_LEFT PP") } record(longout, "XCOR:AS01:341:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "XCOR:AS01:341:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "XCOR:AS01:341:RAMPDONE_CALC") } record(calc, "XCOR:AS01:341:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "XCOR:AS01:341:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "XCOR:AS01:341:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "XCOR:AS01:341: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, "XCOR:AS01:341:RAMPTIME_LEFT") field(OUT, "XCOR:AS01:341:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "XCOR:AS01:341:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "XCOR:AS01:341:RAMPTIME_LEFT NMS") field(OUT, "XCOR:AS01:341:RAMPDONE PP") } record(bo, "XCOR:AS01:341:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "XCOR:AS01:341:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "XCOR:AS01:341: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, "XCOR:AS01:341: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, "XCOR:AS01:341:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "XCOR:AS01:341:DEBUG.PROC PP") field(LNK2, "XCOR:AS01:341:STDZCYCLENUM.PROC PP") field(LNK3, "XCOR:AS01:341:STDZDISABLE.PROC PP") field(LNK4, "XCOR:AS01:341: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, "XCOR:AS01:341:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "XCOR:AS01:341:STDZIMIN NPP NMS") field(INPB, "XCOR:AS01:341:STDZIMAX NPP NMS") field(INPC, "XCOR:AS01:341:STDZIFINAL NPP NMS") field(INPD, "XCOR:AS01:341:STDZCYCLENUM NPP NMS") field(INPE, "XCOR:AS01:341:STDZDIRECT.RVAL NPP NMS") field(INPF, "XCOR:AS01:341:STDZDISABLE.RVAL CPP NMS") field(INPG, "XCOR:AS01:341: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, "XCOR:AS01:341:STDZWF PP") field(OUTB, "XCOR:AS01:341: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, "XCOR:AS01:341:STDZWF") } record(mbbo, "XCOR:AS01:341: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, "XCOR:AS01:341: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, "XCOR:AS01:341:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "XCOR:AS01:341: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, "XCOR:AS01:341: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, "XCOR:AS01:341: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, "XCOR:AS01:341:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "XCOR:AS01:341:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "XCOR:AS01:341:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "XCOR:AS01:341: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, "XCOR:AS01:341:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "XCOR:AS01:341:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "XCOR:AS01:341:STDZIMIN") } record(ao, "XCOR:AS01:341:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(VAL, "-6.0") field(FLNK, "XCOR:AS01:341:STDZIMAX") } record(ao, "XCOR:AS01:341:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(VAL, "6.0") field(FLNK, "XCOR:AS01:341:STDZIFINAL") } record(ao, "XCOR:AS01:341:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(VAL, "-6.0") field(FLNK, "XCOR:AS01:341: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, "XCOR:AS01:341: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, "XCOR:AS01:341:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "XCOR:AS01:341:STDZIMIN CP NMS") field(INPB, "XCOR:AS01:341:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "XCOR:AS01:341:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "XCOR:AS01:341:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "XCOR:AS01:341:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "XCOR:AS01:341:STDZIMIN CP NMS") field(INPB, "XCOR:AS01:341:STDZIMAX CP NMS") field(INPC, "XCOR:AS01:341:TRIMRAMPRATE CP NMS") field(INPD, "1.0") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "XCOR:AS01:341:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "XCOR:AS01:341:TRIMDLYPCT CP MS") field(INPB, "XCOR:AS01:341: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, "XCOR:AS01:341:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "XCOR:AS01:341: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, "XCOR:AS01:341:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "XCOR:AS01:341:IDES.HOPR") field(INPB, "XCOR:AS01:341:STDZMINIPCT CPP NMS") field(INPC, "XCOR:AS01:341:IDES.LOPR") field(PREC, "5") } record(calc, "XCOR:AS01:341:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "XCOR:AS01:341:IDES.HOPR") field(INPB, "XCOR:AS01:341:IDES.LOPR") field(INPC, "XCOR:AS01:341:STDZDIRECT.RVAL") field(INPD, "XCOR:AS01:341:STDZMINIDELTA") field(INPE, "XCOR:AS01:341:IDES") field(PREC, "5") field(FLNK, "XCOR:AS01:341: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, "XCOR:AS01:341:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "XCOR:AS01:341:IDES.HOPR") field(INPB, "XCOR:AS01:341:IDES.LOPR") field(INPC, "XCOR:AS01:341:STDZDIRECT.RVAL") field(INPD, "XCOR:AS01:341:STDZMINIDELTA") field(INPE, "XCOR:AS01:341: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, "XCOR:AS01:341: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, "XCOR:AS01:341:IADJUST.RVAL") field(INPB, "XCOR:AS01:341:STDZDIRECT.RVAL") field(INPC, "XCOR:AS01:341:STDZOK.RVAL") field(INPD, "XCOR:AS01:341:STDZDISABLE.RVAL") field(INPE, "XCOR:AS01:341:STATE.RVAL CPP NMS") field(INPF, "XCOR:AS01:341:ICTRL.RVAL") field(INPG, "XCOR:AS01:341:STATE.SEVR") field(INPH, "XCOR:AS01:341:BDELTAS.M") field(INPI, "XCOR:AS01:341:IACT.SEVR") field(OUT, "XCOR:AS01:341:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "XCOR:AS01:341:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "XCOR:AS01:341:STDZLOSTTOD.PROC") field(LNK2, "XCOR:AS01:341:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "XCOR:AS01:341:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "XCOR:AS01:341:CHECKPWRDIP_ENABLE") field(INPA, "XCOR:AS01:341:IACT CP") field(INPB, "XCOR:AS01:341:STDZIACTMAX") field(EGU, "A") field(FLNK, "XCOR:AS01:341: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, "XCOR:AS01:341:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "XCOR:AS01:341:CHECKPWRDIP_ENABLE") field(INPA, "XCOR:AS01:341:STDZIACTMAX") field(INPB, "XCOR:AS01:341:IACT") field(INPC, "XCOR:AS01:341:IDELTAS.I") field(OUT, "XCOR:AS01:341: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, "XCOR:AS01:341:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "XCOR:AS01:341:STDZOK.RVAL CP") field(INPB, "XCOR:AS01:341:STDZDISABLE.RVAL CP") field(INPC, "XCOR:AS01:341: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, "XCOR:AS01:341: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, "XCOR:AS01:341:CALBOK") { field(DESC, "Successful Calibration") field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "") 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, "XCOR:AS01:341:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "XCOR:AS01:341:CALBOK") field(INPB, "XCOR:AS01:341:CALBDISABLE") field(INPC, "XCOR:AS01:341:CALBSLOPE") field(OOPT, "On Change") field(OUT, "XCOR:AS01:341: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, "XCOR:AS01:341:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "XCOR:AS01:341: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, "XCOR:AS01:341:CALBSLOPE") field(DOL3, "XCOR:AS01:341:CALBOFFSET") field(DOL4, "0") field(DOL5, "0") field(LNK1, "MCOR:AS01:109:VSETPT.DISA PP NMS") field(LNK2, "MCOR:AS01:109:VSETPT.ASLO PP NMS") field(LNK3, "MCOR:AS01:109:VSETPT.AOFF PP NMS") field(LNK4, "MCOR:AS01:109:VSETPT.LINR PP NMS") field(LNK5, "MCOR:AS01:109:VSETPT.DISA PP NMS") # # 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, "MCOR:AS01:109:VSETPT.DISA PP NMS") field(LNK7, "MCOR:AS01:109:VSETPT.ASLO PP NMS") field(LNK8, "MCOR:AS01:109:VSETPT.AOFF PP NMS") field(LNK9, "MCOR:AS01:109:VSETPT.LINR PP NMS") field(LNKA, "MCOR:AS01:109:VSETPT.DISA PP NMS") } record(stringout, "XCOR:AS01:341:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "XCOR:AS01:341: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, "XCOR:AS01:341: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, "XCOR:AS01:341: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, "XCOR:AS01:341:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "XCOR:AS01:341: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, "XCOR:AS01:341:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "MCOR:AS01:109:VSETPT.ESLO") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "XCOR:AS01:341:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "XCOR:AS01:341:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "MCOR:AS01:109:VSETPT.EOFF") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "XCOR:AS01:341: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, "XCOR:AS01:341:CALCDAC") { field(DESC, "IACT to DAC Counts") field(CALC, "D=0?0:(((C*A)+B)-E)/D") field(INPA, "MCOR:AS01:109:I2VSLOPE") field(INPB, "0.0") field(INPC, "XCOR:AS01:341:IACT") field(INPD, "XCOR:AS01:341:DACSLOPE") field(INPE, "XCOR:AS01:341:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "XCOR:AS01:341:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "MCOR:AS01:109:VSETPT.RVAL CP") field(OMSL, "closed_loop") field(PREC, "6") field(PINI, "YES") } record(ao, "XCOR:AS01:341:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "6.0") field(HOPR, "6.0") field(DRVL, "-6.0") field(LOPR, "-6.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "XCOR:AS01:341:CALBIMAX") } record(ao, "XCOR:AS01:341:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "6.0") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVL, "-6.0") field(EGU, "A") field(VAL, "6.0") field(FLNK, "XCOR:AS01:341:CALBSTEPNUM") } record(ao, "XCOR:AS01:341:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(VAL, "0") } record(longout, "XCOR:AS01:341: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, "XCOR:AS01:341:CALBIDELTA") } record(calc, "XCOR:AS01:341:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "XCOR:AS01:341:CALBIMAX") field(INPB, "XCOR:AS01:341:CALBIMIN") field(INPC, "XCOR:AS01:341: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, "XCOR:AS01:341:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "MCOR:AS01:109:ISETPT.DRVH") field(INPB, "MCOR:AS01:109:IACT.HOPR") field(INPC, "XCOR:AS01:341:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "XCOR:AS01:341:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "XCOR:AS01:341:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "XCOR:AS01:341:DACSA") } # Used only for xygraph edm plot record(subArray, "XCOR:AS01:341:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "XCOR:AS01:341: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, "XCOR:AS01:341:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "XCOR:AS01:341:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "XCOR:AS01:341:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "XCOR:AS01:341: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, "XCOR:AS01:341:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "XCOR:AS01:341:CALBYSA") } # Used only for xygraph edm plot record(subArray, "XCOR:AS01:341:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "XCOR:AS01:341:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "XCOR:AS01:341:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "XCOR:AS01:341:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "XCOR:AS01:341:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "XCOR:AS01:341:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "XCOR:AS01:341:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "XCOR:AS01:341: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, "XCOR:AS01:341:CALBSTEPNUM") field(INPB, "XCOR:AS01:341:CALBIACTWF") field(INPC, "XCOR:AS01:341: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, "XCOR:AS01:341: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, "XCOR:AS01:341:STDZITOL") field(INPH, "XCOR:AS01:341:DACSLOPE") field(INPI, "XCOR:AS01:341: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, "XCOR:AS01:341: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, "XCOR:AS01:341:CALBSTEPNUM") field(INPB, "XCOR:AS01:341:CALBIACTWF") field(INPC, "XCOR:AS01:341:DACWF") field(INPF, "XCOR:AS01:341: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 XCOR:AS01:341CALBOK 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, "XCOR:AS01:341:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "XCOR:AS01:341:DEGAUSIMIN.PROC PP") field(OUTB, "XCOR:AS01:341:DEGAUSIMAX.PROC PP") field(OUTC, "XCOR:AS01:341:DEGAUSTYPE.PROC PP") field(OUTD, "XCOR:AS01:341:DEGAUSSTEP.PROC PP") field(OUTE, "XCOR:AS01:341:MADNAME.PROC PP") field(OUTF, "XCOR:AS01:341:PSTYPE.PROC PP") field(OUTG, "XCOR:AS01:341: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, "XCOR:AS01:341:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "XCOR:AS01:341:DEGAUSIMIN NPP NMS") field(INPB, "XCOR:AS01:341:DEGAUSIMAX NPP NMS") field(INPC, "XCOR:AS01:341:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "XCOR:AS01:341:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "XCOR:AS01:341:PSTYPE NPP NMS") field(INPG, "XCOR:AS01:341:DEBUG.RVAL NPP NMS") field(INPH, "XCOR:AS01:341: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, "XCOR:AS01:341:DEGAUSWF PP") field(OUTB, "XCOR:AS01:341:DEGAUSMSG PP") field(OUTC, "XCOR:AS01:341: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, "XCOR:AS01:341:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"XCOR:AS01:341: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, "XCOR:AS01:341: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, "XCOR:AS01:341: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, "XCOR:AS01:341: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, "XCOR:AS01:341: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, "XCOR:AS01:341:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(VAL, "-6.0") } record(ao, "XCOR:AS01:341:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(VAL, "6.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,"XCOR:AS01:341: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, "XCOR:AS01:341: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,"XCOR:AS01:341: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, "XCOR:AS01:341: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, "XCOR:AS01:341: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, "XCOR:AS01:341: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, "XCOR:AS01:341:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "XCOR:AS01:341:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "XCOR:AS01:341:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "XCOR:AS01:341:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "XCOR:AS01:341: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, "XCOR:AS01:341:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "XCOR:AS01:341: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, "XCOR:AS01:341:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "XCOR:AS01:341:DEGAUS_IMAX") field(INPB, "XCOR:AS01:341:ISETPT") field(INPC, "XCOR:AS01:341:DEGAUSTYPE.RVAL") field(OUT, "XCOR:AS01:341:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "XCOR:AS01:341:DEGAUS_IMAX_UPDATE") } record(seq, "XCOR:AS01:341:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "XCOR:AS01:341:ISETPT") field(LNK1, "XCOR:AS01:341:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "XCOR:AS01:341:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(VAL, "6.0") field(FLNK, "XCOR:AS01:341:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "XCOR:AS01:341:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "XCOR:AS01:341:DEGAUS_IMAX") field(FLNK, "XCOR:AS01:341:DEGAUS_IMAXPOL") } record(bo, "XCOR:AS01:341:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "XCOR:AS01:341:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "XCOR:AS01:341: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, "XCOR:AS01:341:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "XCOR:AS01:341:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "6.0") field(LOPR, "-6.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "XCOR:AS01:341:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "XCOR:AS01:341:IACT") field(INPB, "XCOR:AS01:341:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "XCOR:AS01:341:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "XCOR:AS01:341:IACTPOL") } record(bo, "XCOR:AS01:341: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,"XCOR:AS01:341: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, "XCOR:AS01:341:DEGAUSENABLE CP") field(INPB, "XCOR:AS01:341:DEGAUSOK") field(INPC, "XCOR:AS01:341:STATE CP") field(INPD, "XCOR:AS01:341:STATE.SEVR") field(OUT, "XCOR:AS01:341:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "XCOR:AS01:341:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "XCOR:AS01:341:DEGAUS_STATE_CHECK") field(LNK1, "XCOR:AS01:341:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "XCOR:AS01:341:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "XCOR:AS01:341:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "XCOR:AS01:341: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, "XCOR:AS01:341:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "XCOR:AS01:341:DEGAUSOK.ZSV") field(LNK2, "XCOR:AS01:341: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, "XCOR:AS01:341:STATMSG.FRSV") field(LNK4, "XCOR:AS01:341: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, "XCOR:AS01:341:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "XCOR:AS01:341:DEGAUSOK.ZSV") field(LNK2, "XCOR:AS01:341: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, "XCOR:AS01:341:STATMSG.FRSV") field(LNK4, "XCOR:AS01:341: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, "XCOR:AS01:341:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "XCOR:AS01:341: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, "XCOR:AS01:341:STATMSG.FRSV") field(LNK3, "XCOR:AS01:341: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, "XCOR:AS01:341:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "XCOR:AS01:341: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, "XCOR:AS01:341:STATMSG.FRSV PP") field(LNK3, "XCOR:AS01:341:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "XCOR:AS01:341:FUNC") { field(DESC, "XCOR:AS01:341 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, "0") field(NIVL, "0") field(TEVL, "0") field(ELVL, "5") field(TVVL, "6") field(TTVL, "7") field(FTVL, "4") field(FFVL, "3") field(OUT, "XCOR:AS01:341:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "XCOR:AS01:341:CTRL") { field(DESC, "XCOR:AS01:341 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, "") field(TVST, "") field(TTST, "") 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, "0") field(TVVL, "0") field(TTVL, "0") field(FTVL, "0") field(FFVL, "0") field(OUT, "XCOR:AS01:341:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "XCOR:AS01:341:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "XCOR:AS01:341:BUSY") } # Set to FREE on IOC reboot record(bo, "XCOR:AS01:341:BUSY") { field(DESC, "XCOR:AS01:341 Ctrl Done") field(DOL, "XCOR:AS01:341:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "XCOR:AS01:341:SELECT") } record(bo, "XCOR:AS01:341:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "XCOR:AS01:341: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, "XCOR:AS01:341:CTRLSTATE") { field(DESC, "XCOR:AS01:341 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("XCOR:AS01:341:CTRL",20,20,0,0,"XCOR:AS01:341:CTRL") #! Field("XCOR:AS01:341:CTRL.OUT",16777215,1,"XCOR:AS01:341:CTRL.OUT") #! Link("XCOR:AS01:341:CTRL.OUT","XCOR:AS01:341:SELECTEN.A") #! Field("XCOR:AS01:341:CTRL.VAL",16777215,1,"XCOR:AS01:341:CTRL.VAL") #! Record("XCOR:AS01:341:SELECTEN",321,381,0,0,"XCOR:AS01:341:SELECTEN") #! Field("XCOR:AS01:341:SELECTEN.A",16777215,0,"XCOR:AS01:341:SELECTEN.A") #! Field("XCOR:AS01:341:SELECTEN.FLNK",16777215,1,"XCOR:AS01:341:SELECTEN.FLNK") #! Link("XCOR:AS01:341:SELECTEN.FLNK","XCOR:AS01:341:BUSY") #! Field("XCOR:AS01:341:SELECTEN.VAL",16777215,1,"XCOR:AS01:341:SELECTEN.VAL") #! Record("XCOR:AS01:341:BUSY",623,274,0,0,"XCOR:AS01:341:BUSY") #! Field("XCOR:AS01:341:BUSY.DOL",16777215,0,"XCOR:AS01:341:BUSY.DOL") #! Link("XCOR:AS01:341:BUSY.DOL","XCOR:AS01:341:SELECTEN.VAL") #! Field("XCOR:AS01:341:BUSY.FLNK",16777215,1,"XCOR:AS01:341:BUSY.FLNK") #! Link("XCOR:AS01:341:BUSY.FLNK","XCOR:AS01:341:SELECT") #! Record("XCOR:AS01:341:SELECT",669,508,0,1,"XCOR:AS01:341:SELECT") #! Record("XCOR:AS01:341:FUNC",940,120,0,0,"XCOR:AS01:341:FUNC") #! Field("XCOR:AS01:341:FUNC.OUT",16777215,0,"XCOR:AS01:341:FUNC.OUT") #! Link("XCOR:AS01:341:FUNC.OUT","XCOR:AS01:341:CTRL.VAL") #! Record("XCOR:AS01:341:ABORT",193,41,0,0,"XCOR:AS01:341:ABORT") #! Record("XCOR:AS01:341:CTRLSTATE",369,34,0,0,"XCOR:AS01:341: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,"XCOR:AS01:341:SELECT is used for Multi-device selection.\nIt is enabled when associated XCOR:AS01:341:CTRL is \"0\" (DONE).\nIt is disabled when associated XCOR:AS01:341: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,"XCOR:AS01:341: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, "XCOR:AS01:341:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "XCOR:AS01:341:BCTRL.SEVR") field(OUT, "XCOR:AS01:341: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, "XCOR:AS01:341:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "XCOR:AS01:341:BACT") field(INPB, "XCOR:AS01:341:POLYCOEF") field(INPC, "XCOR:AS01:341:POLYCOEF.A") field(INPD, "XCOR:AS01:341:POLYCOEF.B") field(INPE, "XCOR:AS01:341:IACT MS") field(INPF, "XCOR:AS01:341:BDELTAS PP") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "120.0") field(LOPR, "-120.0") field(HIHI, "120.0") field(LOLO, "-120.0") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "120.0") field(LOW, "-120.0") field(FLNK, "XCOR:AS01:341: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, "XCOR:AS01:341: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, "XCOR:AS01:341:BDES") field(INPB, "XCOR:AS01:341:TRIMBTOL") field(INPC, "XCOR:AS01:341:TRIMBTOLR") field(INPD, "XCOR:AS01:341:CHCKBTOL") field(INPE, "XCOR:AS01:341:CHCKBTOLR") field(F, "0.0") field(INPG, "30") field(INPH, "XCOR:AS01:341:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "XCOR:AS01:341:MPSBTOL") field(INPQ, "XCOR:AS01:341:MPSBTOLR") field(FLNK, "XCOR:AS01:341:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "XCOR:AS01:341:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "XCOR:AS01:341:BDES") field(INPB, "XCOR:AS01:341:BDELTAS.I") field(INPG, "XCOR:AS01:341:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "XCOR:AS01:341:BCON.HIGH") field(OUTB, "XCOR:AS01:341:BCON.LOW") field(OUTC, "XCOR:AS01:341:BCON.HIHI") field(OUTD, "XCOR:AS01:341:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "XCOR:AS01:341:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "XCOR:AS01:341:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "XCOR:AS01:341:BDIFF") field(LNK2, "XCOR:AS01:341:BADIFF") field(LNK3, "XCOR:AS01:341:BRATIO") field(LNK4, "XCOR:AS01:341:MPSLIMITS") field(LNK5, "XCOR:AS01:341:I2BSTATUS") field(LNK6, "XCOR:AS01:341:IACTFO.PROC") } record(calc, "XCOR:AS01:341:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "XCOR:AS01:341:BDES") field(INPB, "XCOR:AS01:341:BACT") field(EGU, "kG-m") field(PREC, "7") } record(calc, "XCOR:AS01:341:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "XCOR:AS01:341:BDIFF") field(EGU, "kG-m") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "XCOR:AS01:341:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "XCOR:AS01:341:BDIFF") field(INPB, "XCOR:AS01:341:BDES.HOPR") field(EGU, "kG-m") field(PREC, "7") } record(mbbi, "XCOR:AS01:341: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, "XCOR:AS01:341:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "XCOR:AS01:341:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "XCOR:AS01:341:BMON") field(INPB, "XCOR:AS01:341:POLYCOEF") field(INPC, "XCOR:AS01:341:POLYCOEF.A") field(INPD, "XCOR:AS01:341:POLYCOEF.B") field(INPE, "XCOR:AS01:341:IMON MS") field(INPF, "XCOR:AS01:341:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "120.0") field(LOPR, "-120.0") field(HIHI, "120.0") field(LOLO, "-120.0") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "120.0") field(LOW, "-120.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=MCOR:AS01:109:BDES CP record(ao, "XCOR:AS01:341:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "120.0") field(DRVL, "-120.0") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "7") field(EGU, "kG-m") field(MDEL, "-1") field(OMSL, "supervisory") # field(DOL, "") field(OUT, "XCOR:AS01:341:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "XCOR:AS01:341:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "XCOR:AS01:341:POLYCOEF") field(INPC, "XCOR:AS01:341:POLYCOEF.A") field(INPD, "XCOR:AS01:341:POLYCOEF.B") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "120.0") field(LOPR, "-120.0") field(MDEL, "-1") field(INPE, "XCOR:AS01:341:BDES.DRVH") field(INPF, "XCOR:AS01:341:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "XCOR:AS01:341:IDES") } record(sub, "XCOR:AS01:341:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "XCOR:AS01:341:POLYCOEF") field(INPC, "XCOR:AS01:341:POLYCOEF.A") field(INPD, "XCOR:AS01:341:POLYCOEF.B") field(INPE, "XCOR:AS01:341:BDES.DRVH") field(INPF, "XCOR:AS01:341:BDES.DRVL") field(EGU, "kG-m") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "7") field(VAL, "0.0") field(FLNK, "XCOR:AS01:341:INOM") } record(sub, "XCOR:AS01:341:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "XCOR:AS01:341:BDES.VAL") field(INPB, "XCOR:AS01:341:BDES.DRVH") field(INPC, "XCOR:AS01:341:BDES.DRVL") field(INPD, "XCOR:AS01:341:BDELTAS.I") field(INPE, "XCOR:AS01:341:BDELTAS.J") field(INPG, "XCOR:AS01:341:STATE") field(INPH, "XCOR:AS01:341:HSTA") field(EGU, "kG-m") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "XCOR:AS01:341:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "XCOR:AS01:341:BDES.VAL") field(INPB, "XCOR:AS01:341:BDES.DRVH") field(INPC, "XCOR:AS01:341:BDES.DRVL") field(INPD, "XCOR:AS01:341:BDELTAS.K") field(INPE, "XCOR:AS01:341:BDELTAS.L") field(INPG, "XCOR:AS01:341:STATE") field(INPH, "XCOR:AS01:341:HSTA") field(EGU, "kG-m") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "XCOR:AS01:341:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "XCOR:AS01:341:BLIMITS") field(LNK1, "XCOR:AS01:341:BACTLIMITS.F PP") field(DOL2, "XCOR:AS01:341:BACTLIMITS.I") field(LNK2, "XCOR:AS01:341:BACT.HIGH") field(DOL3, "XCOR:AS01:341:BACTLIMITS.J") field(LNK3, "XCOR:AS01:341:BACT.LOW") field(DOL4, "XCOR:AS01:341:BACTLIMITS.K") field(LNK4, "XCOR:AS01:341:BACT.HIHI") field(DOL5, "XCOR:AS01:341:BACTLIMITS.L") field(LNK5, "XCOR:AS01:341:BACT.LOLO") field(DOL6, "XCOR:AS01:341:BLIMITS") field(LNK6, "XCOR:AS01:341:BMONLIMITS.F PP") field(DOL7, "XCOR:AS01:341:BMONLIMITS.I") field(LNK7, "XCOR:AS01:341:BMON.HIGH") field(DOL8, "XCOR:AS01:341:BMONLIMITS.J") field(LNK8, "XCOR:AS01:341:BMON.LOW") field(DOL9, "XCOR:AS01:341:BMONLIMITS.K") field(LNK9, "XCOR:AS01:341:BMON.HIHI") field(DOLA, "XCOR:AS01:341:BMONLIMITS.L") field(LNKA, "XCOR:AS01:341:BMON.LOLO") field(FLNK, "XCOR:AS01:341:ILIMITS") field(SCAN, "5 second") } record(ao, "XCOR:AS01:341:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG-m") field(DRVH, "120.0") field(DRVL, "-120.0") field(HOPR, "120.0") field(LOPR, "-120.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, "XCOR:AS01:341: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, "XCOR:AS01:341:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "XCOR:AS01:341:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "XCOR:AS01:341:BCTRL.VAL") field(LNK2, "XCOR:AS01:341:BDES PP") field(DOL3, "1") field(LNK3, "XCOR:AS01:341:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "XCOR:AS01:341:CHECKSTDZLOST.PROC PP") field(DOL5, "XCOR:AS01:341:BCTRL.VAL") field(LNK5, "XCOR:AS01:341:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "XCOR:AS01:341:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "XCOR:AS01:341:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "XCOR:AS01:341:POLYCOEF") field(INPC, "XCOR:AS01:341:POLYCOEF.A") field(INPD, "XCOR:AS01:341:POLYCOEF.B") field(INPE, "XCOR:AS01:341:BDES.DRVH") field(INPF, "XCOR:AS01:341:BDES.DRVL") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "120.0") field(LOPR, "-120.0") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "XCOR:AS01:341:ISETPT") } record(ao, "XCOR:AS01:341:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "120.0") field(DRVL, "-120.0") field(EGU, "kG-m") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "XCOR:AS01:341:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "XC03S") } record(ai, "XCOR:AS01:341: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, "2021.318") } record(ao, "XCOR:AS01:341:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "120.0") field(DRVL, "-120.0") field(EGU, "kG-m") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "7") field(PINI, "YES") field(VAL, "120.0") field(FLNK, "XCOR:AS01:341:BSTEP") } record(ao, "XCOR:AS01:341:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "120.0") field(DRVL, "-120.0") field(EGU, "kG-m") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "7") field(PINI, "YES") field(VAL, "-120.0") field(FLNK, "XCOR:AS01:341:BSTEP") } record(ao, "XCOR:AS01:341:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "120.0") field(DRVL, "-120.0") field(EGU, "kG-m") field(HOPR, "120.0") field(LOPR, "-120.0") field(PINI, "YES") field(PREC, "7") } # This record is processed by XCOR:AS01:341: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, "XCOR:AS01:341:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVH, "120.0") field(DRVL, "-120.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, "XCOR:AS01:341:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "XCOR:AS01:341:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "XCOR:AS01:341:POLYCOEF") field(INPC, "XCOR:AS01:341:POLYCOEF.A") field(INPD, "XCOR:AS01:341:POLYCOEF.B") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "120.0") field(LOPR, "-120.0") field(MDEL, "-1") field(INPE, "XCOR:AS01:341:BCON.DRVH") field(INPF, "XCOR:AS01:341:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "XCOR:AS01:341: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, "XCOR:AS01:341:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "XCOR:AS01:341:BMAX") field(INPB, "XCOR:AS01:341:BMIN") field(INPC, "XCOR:AS01:341:BMIN.SEVR") field(INPD, "XCOR:AS01:341: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,"XCOR:AS01:341:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "XCOR:AS01:341:ONLINE CP") field(OUT, "XCOR:AS01:341:BCTRLDISABLEFOUT PP") } record(fanout, "XCOR:AS01:341:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "XCOR:AS01:341:BCTRLDISABLECALC") field(LNK1, "XCOR:AS01:341:BCTRLDISABLE") field(LNK2, "XCOR:AS01:341:BCTRLENABLE") } record(stringout, "XCOR:AS01:341:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "XCOR:AS01:341:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "XCOR:AS01:341:BCTRLDISV_UPDATE") } record(stringout, "XCOR:AS01:341:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "XCOR:AS01:341:BCTRL.ASG") field(VAL, "") field(FLNK, "XCOR:AS01:341:BCTRLDISV_UPDATE") } record(calcout, "XCOR:AS01:341:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "XCOR:AS01:341:ONLINE") field(OUT, "XCOR:AS01:341: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,"XCOR:AS01:341:BACT and MON\n are processed via links from \n XCOR:AS01:341:IACT (device raw value readback 1)\n and\n XCOR:AS01:341: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 XCOR:AS01:341:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = XCOR:AS01:341: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,"XCOR:AS01:341:BDES\n is processed when set by CA users or \n XCOR:AS01:341: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,"XCOR:AS01:341: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 XCOR:AS01:341: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 (XCOR:AS01:341: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,"XCOR:AS01:341:B*LIMITS and XCOR:AS01:341:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from XCOR:AS01:341: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,"XCOR:AS01:341: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,"XCOR:AS01:341: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, "XCOR:AS01:341: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, "XCOR:AS01:341:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG-m") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "XCOR:AS01:341:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "XCOR:AS01:341:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "120.0") field(DRVL, "-120.0") field(PINI, "YES") field(VAL, "120.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "XCOR:AS01:341:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "120.0") field(DRVL, "-120.0") field(PINI, "YES") field(VAL, "-120.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "XCOR:AS01:341:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "120.0") field(DRVL, "-120.0") field(PINI, "YES") field(VAL, "-120.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "XCOR:AS01:341:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "120.0") field(DRVL, "-120.0") field(PINI, "YES") field(VAL, "-120.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "XCOR:AS01:341: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, "XCOR:AS01:341:MPSLIMITS.E PP") } record(aSub, "XCOR:AS01:341: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, "XCOR:AS01:341:MPS.RVAL") field(INPB, "XCOR:AS01:341:BADIFF") field(INPC, "XCOR:AS01:341:BDELTAS.N") field(INPD, "XCOR:AS01:341:BACT") field(INPE, "XCOR:AS01:341:MPSBITMASK.RVAL") field(INPF, "XCOR:AS01:341:MPSBLLIM") field(INPG, "XCOR:AS01:341:MPSBMIN") field(INPH, "XCOR:AS01:341:MPSBMAX") field(INPI, "XCOR:AS01:341: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, "XCOR:AS01:341:INTOL.RVAL PP") field(OUTB, "XCOR:AS01:341:INTOL_BMIN.RVAL PP") field(OUTC, "XCOR:AS01:341:INTOL_BRANGE.RVAL PP") field(OUTD, "XCOR:AS01:341: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, "XCOR:AS01:341:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "XCOR:AS01:341:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "XCOR:AS01:341:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "XCOR:AS01:341:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "XCOR:AS01:341:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "XCOR:AS01:341:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "XCOR:AS01:341:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "XCOR:AS01:341: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, "XCOR:AS01:341:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "XCOR:AS01:341:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "XCOR:AS01:341:CHCKBTOL") field(INPB, "XCOR:AS01:341:POLYCOEF.B") field(PREC, "9") } record(calc, "XCOR:AS01:341: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, "XCOR:AS01:341:CHCKBTOL") field(FLNK, "XCOR:AS01:341:CHCKITOL") } record(calc, "XCOR:AS01:341:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "XCOR:AS01:341:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "XCOR:AS01:341:BDES.HOPR") field(INPB, "XCOR:AS01:341:STABILITY") field(INPC, "XCOR:AS01:341:BDES.LOPR") } record(longout, "XCOR:AS01:341:STABILITY") { field(DESC, "Long Term Stability") field(PINI, "YES") field(VAL, "1000") field(EGU, "ppm") field(DRVH, "3000") field(DRVL, "100") field(HOPR, "3000") field(LOPR, "100") field(FLNK, "XCOR:AS01:341:CHCKBTOL") } record(calc, "XCOR:AS01:341:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG-m") field(CALC, "ABS(A*B)") field(INPA, "XCOR:AS01:341:POLYCOEF.B") field(INPB, "XCOR:AS01:341:TRIMBTOL") field(PREC, "9") } record(ai, "XCOR:AS01:341:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "XCOR:AS01:341: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, "XCOR:AS01:341:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "XCOR:AS01:341:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "XCOR:AS01:341:PAUGO") } record(fanout, "XCOR:AS01:341:PAUGO") { field(DESC, "PAU control") field(LNK1, "XCOR:AS01:341:PAUSTOP") field(LNK2, "XCOR:AS01:341: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, "XCOR:AS01:341:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "XCOR:AS01:341:PAU.RVAL") field(DISV, "0") field(DOL1, "0") field(DOL2, "0") field(DOL3, "1") field(DLY3, "1") # field(LNK1, "MCOR:AS01:109:ISETPT.DISV") # field(LNK2, "MCOR:AS01:109:VSETPT.DISV") # field(LNK3, "ACTPAU PP") } record(seq, "XCOR:AS01:341:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "XCOR:AS01:341:PAU.RVAL") field(DISV, "1") field(DOL1, "1") field(DOL2, "1") field(DOL3, "0") # field(LNK1, "MCOR:AS01:109:ISETPT.DISV") # field(LNK2, "MCOR:AS01:109:VSETPT.DISV") # field(LNK3, "ACTPAU PP") } # Change attribute to PSDEVNAME record(stringout, "XCOR:AS01:341:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "MCOR:AS01:109:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "XCOR:AS01:341: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, "XCOR:AS01:341:PSTYPE.RVAL") field(INPC, "XCOR:AS01:341:TURNEDOFF.RVAL") field(INPD, "XCOR:AS01:341:CONFIG.RVAL") field(INPE, "XCOR:AS01:341:PSCATEGORY.RVAL") field(INPF, "XCOR:AS01:341:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "XCOR:AS01:341:AUTOCTRL.RVAL") field(INPJ, "XCOR:AS01:341:OUTOFSERVICE.RVAL") field(INPL, "XCOR:AS01:341:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "XCOR:AS01:341:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "XCOR:AS01:341:PAU") field(INPP, "XCOR:AS01:341:CALBDISABLE.RVAL") field(INPQ, "XCOR:AS01:341:PTRBDISABLE.RVAL") field(INPR, "XCOR:AS01:341:TRIMDISABLE.RVAL") field(INPS, "XCOR:AS01:341:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "XCOR:AS01:341:FBCK") field(INPU, "XCOR:AS01:341:TRIMTYPE.RVAL") field(INPV, "XCOR:AS01:341:STDZDIRECT.RVAL") field(INPW, "XCOR:AS01:341:DEGAUSENABLE.RVAL") field(FLNK, "XCOR:AS01:341:HSTA") } record(longin, "XCOR:AS01:341:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "XCOR:AS01:341:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "XCOR:AS01:341: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, "XCOR:AS01:341: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, "XCOR:AS01:341: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, "XCOR:AS01:341: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, "XCOR:AS01:341: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, "XCOR:AS01:341: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 XCOR:AS01:341:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses XCOR:AS01:341:FBCK. # This PV should be replaced by XCOR:AS01:341: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, "XCOR:AS01:341: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, "XCOR:AS01:341: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, "XCOR:AS01:341: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, "XCOR:AS01:341:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"XCOR:AS01:341:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "XCOR:AS01:341:OUTOFSERVICE NPP NMS") field(OUT, "XCOR:AS01:341:ONLINE PP") } record(bo, "XCOR:AS01:341:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "XCOR:AS01:341: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, "XCOR:AS01:341: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, "XCOR:AS01:341: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, "XCOR:AS01:341: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, "XCOR:AS01:341: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, "XCOR:AS01:341: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, "XCOR:AS01:341: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, "XCOR:AS01:341: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, "XCOR:AS01:341: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, "0") field(ASG, "NOWRITE") } record(mbbo, "XCOR:AS01:341: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, "0") field(ASG, "NOWRITE") } record(mbbo, "XCOR:AS01:341: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, "XCOR:AS01:341:TRIMTYPE") } record(stringout, "XCOR:AS01:341:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "XCOR:AS01:341:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "XCOR:AS01:341:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "XCOR:AS01:341:STATE.RVAL") field(INPB, "XCOR:AS01:341:INTLKSUMY.RVAL") field(OUT, "XCOR:AS01:341:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "XCOR:AS01:341: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, "XCOR:AS01:341:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "XCOR:AS01:341:STATE.RVAL") field(INPB, "XCOR:AS01:341:INTLKSUMY.RVAL") field(OUT, "XCOR:AS01:341:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "XCOR:AS01:341:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "XCOR:AS01:341:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "XCOR:AS01:341: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, "XCOR:AS01:341: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, "XCOR:AS01:341: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, "XCOR:AS01:341: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,"XCOR:AS01:341: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("XCOR:AS01:341:TURNEDOFF",3140,1907,0,1,"XCOR:AS01:341:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "XCOR:AS01:341:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "XCOR:AS01:341:BACT.STAT") field(INPB, "XCOR:AS01:341:BDES.STAT") field(INPC, "XCOR:AS01:341:IRIPL.STAT") field(INPD, "MCOR:AS01:109:VSETPT.STAT") field(INPE, "MCOR:AS01:109:VACT.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, "XCOR:AS01:341:BACT.SEVR") field(INPH, "XCOR:AS01:341:BDES.SEVR") field(INPI, "XCOR:AS01:341:IRIPL.SEVR") field(INPJ, "MCOR:AS01:109:VSETPT.SEVR") field(INPK, "MCOR:AS01:109:VACT.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, "XCOR:AS01:341:STATE.RVAL") field(INPN, "XCOR:AS01:341:STDZOK") field(INPO, "XCOR:AS01:341:CALBOK") field(INPP, "XCOR:AS01:341:OUTOFSERVICE.RVAL") field(INPQ, "XCOR:AS01:341:CONFIG.RVAL") field(INPR, "XCOR:AS01:341:HSTA") field(INPS, "XCOR:AS01:341:CTRL.RVAL") field(INPT, "XCOR:AS01:341:DEGAUSOK") field(INPV, "XCOR:AS01:341: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, "XCOR:AS01:341:STAT") } record(longout, "XCOR:AS01:341:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "XCOR:AS01:341:STATCTRLSUB") field(DOL, "XCOR:AS01:341:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "XCOR:AS01:341:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "XCOR:AS01:341:STAT") field(INPB, "XCOR:AS01:341:HSTA") field(INPD, "XCOR:AS01:341:ONOFFCTRL.RVAL") field(FLNK, "XCOR:AS01:341:STATMSG") } record(mbbo, "XCOR:AS01:341: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, "XCOR:AS01:341:UNAVAILGO") field(DOL, "XCOR:AS01:341:STATCTRLSUB.W") } record(seq, "XCOR:AS01:341:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "XCOR:AS01:341:STATSUB.U") field(LNK1, "XCOR:AS01:341:UNAVAIL PP") } record(stringout, "XCOR:AS01:341:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"XCOR:AS01:341:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - XCOR:AS01:341:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - XCOR:AS01:341: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,"XCOR:AS01:341STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - XCOR:AS01:341:STATUS\nC - XCOR:AS01:341:ON\nD - XCOR:AS01:341:STDZOK\nE - XCOR:AS01:341:CALBOK\nF - XCOR:AS01:341:BACTDRIFT (future)\nG -\nH- XCOR:AS01:341:DACSTATUS\nI -XCOR:AS01:341:ADCSTATUS\nJ - XCOR:AS01:341:BACTSTATUS\nK - XCOR:AS01:341:BDESSTATUS\nL - XCOR:AS01:341:RIPLSTATUS\n\nOutput:\nP - XCOR:AS01:341: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, "XCOR:AS01:341: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, "XCOR:AS01:341: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, "XCOR:AS01:341: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, "XCOR:AS01:341: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 # Note: for slave with trim coils # set the macro ACT to the following: # ACT=:IACTCALC record(ai, "YCOR:AS01:342:IACT") { field(DESC, "Current") field(INP, "MCOR:AS01:110:IACT") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "YCOR:AS01:342:BACT") info(autosaveFields,"HYST") } record(bi, "YCOR:AS01:342:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "MCOR:AS01:110:STATE NPP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "YCOR:AS01:342:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "6.0") field(LOLO, "-6.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "YCOR:AS01:342:BDELTAS") field(DRVH, "6.0") field(DRVL, "-6.0") field(DOL, "YCOR:AS01:342: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, "YCOR:AS01:342:ICTRL PP") } # This record is processed by YCOR:AS01:342:ICON") # Note: we are not setting alarms here. record(ao, "YCOR:AS01:342:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(DOL, "YCOR:AS01:342:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "YCOR:AS01:342:INOM") { field(DESC, "Nominal Current") field(DOL, "YCOR:AS01:342:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "6.0") field(DRVL, "-6.0") field(HOPR, "6.0") field(LOPR, "-6.0") } record(ao, "YCOR:AS01:342:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(MDEL, "-1") field(FLNK, "YCOR:AS01:342:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "YCOR:AS01:342:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "YCOR:AS01:342:ISETPT.OMSL") field(DOL2, "YCOR:AS01:342:ICTRL") field(LNK2, "YCOR:AS01:342:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "YCOR:AS01:342:ISETPT.OMSL") } record(ao, "YCOR:AS01:342:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "6.0") field(DRVL, "-6.0") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(PINI, "YES") field(VAL, "6.0") field(FLNK, "YCOR:AS01:342:IMIN") } record(ao, "YCOR:AS01:342:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "6.0") field(DRVL, "-6.0") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(VAL, "-6.0") field(FLNK, "YCOR:AS01:342:IRANGE") } record(sel, "YCOR:AS01:342:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(NVL, "YCOR:AS01:342:BACT.SEVR") field(INPA, "YCOR:AS01:342:IACT NPP MS") field(INPB, "YCOR:AS01:342:IACTPREVOK NPP MS") field(INPC, "YCOR:AS01:342:IACTPREVOK NPP MS") field(INPD, "YCOR:AS01:342:IACTPREVOK NPP MS") } record(sub, "YCOR:AS01:342:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "YCOR:AS01:342:IDES") field(INPB, "YCOR:AS01:342:ISETPT.DRVH") field(INPC, "YCOR:AS01:342:ISETPT.DRVL") field(INPD, "YCOR:AS01:342:IDELTAS.I") field(INPE, "YCOR:AS01:342:IDELTAS.J") field(INPG, "YCOR:AS01:342:STATE") field(INPH, "YCOR:AS01:342:HSTA") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "YCOR:AS01:342:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "YCOR:AS01:342:IDES") field(INPB, "YCOR:AS01:342:ISETPT.DRVH") field(INPC, "YCOR:AS01:342:ISETPT.DRVL") field(INPD, "YCOR:AS01:342:IDELTAS.K") field(INPE, "YCOR:AS01:342:IDELTAS.L") field(INPG, "YCOR:AS01:342:STATE") field(INPH, "YCOR:AS01:342:HSTA") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "YCOR:AS01:342:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "YCOR:AS01:342:BLIMITS") field(LNK1, "YCOR:AS01:342:IACTLIMITS.F PP") field(DOL2, "YCOR:AS01:342:IACTLIMITS.I") field(LNK2, "YCOR:AS01:342:IACT.HIGH") field(DOL3, "YCOR:AS01:342:IACTLIMITS.J") field(LNK3, "YCOR:AS01:342:IACT.LOW") field(DOL4, "YCOR:AS01:342:IACTLIMITS.K") field(LNK4, "YCOR:AS01:342:IACT.HIHI") field(DOL5, "YCOR:AS01:342:IACTLIMITS.L") field(LNK5, "YCOR:AS01:342:IACT.LOLO") field(DOL6, "YCOR:AS01:342:BLIMITS") field(LNK6, "YCOR:AS01:342:IMONLIMITS.F PP") field(DOL7, "YCOR:AS01:342:IMONLIMITS.I") field(LNK7, "YCOR:AS01:342:IMON.HIGH") field(DOL8, "YCOR:AS01:342:IMONLIMITS.J") field(LNK8, "YCOR:AS01:342:IMON.LOW") field(DOL9, "YCOR:AS01:342:IMONLIMITS.K") field(LNK9, "YCOR:AS01:342:IMON.HIHI") field(DOLA, "YCOR:AS01:342:IMONLIMITS.L") field(LNKA, "YCOR:AS01:342: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, "YCOR:AS01:342:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "YCOR:AS01:342:TRIMBTOL") field(INPE, "YCOR:AS01:342:CHCKBTOL") field(INPF, "YCOR:AS01:342:BDELTAS.K") field(INPG, "YCOR:AS01:342:BDELTAS.L") field(INPH, "YCOR:AS01:342: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, "YCOR:AS01:342:STDZITOLR") field(INPC, "YCOR:AS01:342:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = MCOR:AS01:110: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, "YCOR:AS01:342: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 = MCOR:AS01:110:RESET PP # record(bo, "YCOR:AS01:342:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "MCOR:AS01:110:RESET PP") } record(bo, "YCOR:AS01:342:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "") 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, "YCOR:AS01:342: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, "YCOR:AS01:342:TRIMRAMPRATE") field(OUT, "") field(FLNK, "YCOR:AS01:342:STDZDLY") } record(ao, "YCOR:AS01:342:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(MDEL, "-1") field(OUT, "MCOR:AS01:110:ISETPT PP") field(DOL, "YCOR:AS01:342: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, "YCOR:AS01:342:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "YCOR:AS01:342:BMON") } record(ao, "YCOR:AS01:342:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "YCOR:AS01:342:IRIPLOK") } record(sub, "YCOR:AS01:342:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "YCOR:AS01:342:IRIPL.VAL") field(INPB, "YCOR:AS01:342: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, "YCOR:AS01:342: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, "YCOR:AS01:342:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") } record(bi, "YCOR:AS01:342:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "MCOR:AS01:110:INTLKSUMY NPP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "YCOR:AS01:342: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, "MCOR:AS01:110:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "YCOR:AS01:342:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "YCOR:AS01:342:IACTPREVOK") field(LNK2, "YCOR:AS01:342:IDIFF") field(LNK3, "YCOR:AS01:342:IADIFF") field(LNK4, "YCOR:AS01:342:IRATIO") field(LNK5, "YCOR:AS01:342:IDIRECT") field(LNK6, "YCOR:AS01:342:IACTPOL_CHECK") } record(calc, "YCOR:AS01:342:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "YCOR:AS01:342:IDES") field(INPB, "YCOR:AS01:342:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "6.0") field(LOPR, "-6.0") } record(calc, "YCOR:AS01:342:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "YCOR:AS01:342:IDIFF") field(PREC, "9") } record(calc, "YCOR:AS01:342:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "YCOR:AS01:342:IDIFF") field(INPB, "YCOR:AS01:342:IDES.DRVH") field(PREC, "9") } record(calcout, "YCOR:AS01:342:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "YCOR:AS01:342:IMIN") field(INPB, "YCOR:AS01:342: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, "YCOR:AS01:342: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, "YCOR:AS01:342:IACT") field(FLNK, "YCOR:AS01:342:IACTPOL") } record(bo, "YCOR:AS01:342:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "YCOR:AS01:342: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,"YCOR:AS01:342:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from YCOR:AS01:342:IDELTAS and the\n YCOR:AS01:342: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,"YCOR:AS01:342:IACT: \n Get copy of YCOR:AS01:342:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"YCOR:AS01:342: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,"YCOR:AS01:342:IDES:\n Contains raw value calculated by \nYCOR:AS01:342: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 \nYCOR:AS01:342:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"YCOR:AS01:342: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 YCOR:AS01:342: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 YCOR:AS01:342: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,"YCOR:AS01:342:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by YCOR:AS01:342:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, YCOR:AS01:342:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n YCOR:AS01:342: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, "YCOR:AS01:342:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "YCOR:AS01:342:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "YCOR:AS01:342:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "YCOR:AS01:342:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "YCOR:AS01:342:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "YCOR:AS01:342:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "0") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "YCOR:AS01:342: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, "YCOR:AS01:342:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "YCOR:AS01:342:TRIMTYPE.RVAL") field(INPB, "YCOR:AS01:342:CONFIG.RVAL") field(OUT, "YCOR:AS01:342:TRIMMAXNUM PP") } record(longout, "YCOR:AS01:342: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, "YCOR:AS01:342: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, "closed_loop") field(VAL, "1") field(OUT, "YCOR:AS01:342:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "YCOR:AS01:342: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, "closed_loop") field(VAL, "10") } record(bo, "YCOR:AS01:342: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, "YCOR:AS01:342: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, "YCOR:AS01:342:TRIMSTEPMIN") { field(DESC, "Min step in current") field(DTYP, "Soft Channel") field(DOL, "MCOR:AS01:110:ISTEP") field(PREC, "7") field(EGUF, "10") field(EGUL, "0") field(EGU, "A") field(HOPR, "10") field(LOPR, "0") field(VAL, "0.0001") } record(bo, "YCOR:AS01:342:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "1") } record(ao, "YCOR:AS01:342: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, "YCOR:AS01:342:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "YCOR:AS01:342: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, "YCOR:AS01:342: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, "YCOR:AS01:342:IMOVE") field(INPB, "YCOR:AS01:342:IACT") field(INPC, "YCOR:AS01:342:IRAMPRATE") field(INPD, "1.0") field(INPE, "YCOR:AS01:342:TRIMDLYPCT") field(INPF, "YCOR:AS01:342:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "YCOR:AS01:342:RAMPTIME_LEFT PP") } record(longout, "YCOR:AS01:342:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "YCOR:AS01:342:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "YCOR:AS01:342:RAMPDONE_CALC") } record(calc, "YCOR:AS01:342:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "YCOR:AS01:342:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "YCOR:AS01:342:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "YCOR:AS01:342: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, "YCOR:AS01:342:RAMPTIME_LEFT") field(OUT, "YCOR:AS01:342:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "YCOR:AS01:342:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "YCOR:AS01:342:RAMPTIME_LEFT NMS") field(OUT, "YCOR:AS01:342:RAMPDONE PP") } record(bo, "YCOR:AS01:342:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "YCOR:AS01:342:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "YCOR:AS01:342: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, "YCOR:AS01:342: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, "YCOR:AS01:342:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "YCOR:AS01:342:DEBUG.PROC PP") field(LNK2, "YCOR:AS01:342:STDZCYCLENUM.PROC PP") field(LNK3, "YCOR:AS01:342:STDZDISABLE.PROC PP") field(LNK4, "YCOR:AS01:342: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, "YCOR:AS01:342:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "YCOR:AS01:342:STDZIMIN NPP NMS") field(INPB, "YCOR:AS01:342:STDZIMAX NPP NMS") field(INPC, "YCOR:AS01:342:STDZIFINAL NPP NMS") field(INPD, "YCOR:AS01:342:STDZCYCLENUM NPP NMS") field(INPE, "YCOR:AS01:342:STDZDIRECT.RVAL NPP NMS") field(INPF, "YCOR:AS01:342:STDZDISABLE.RVAL CPP NMS") field(INPG, "YCOR:AS01:342: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, "YCOR:AS01:342:STDZWF PP") field(OUTB, "YCOR:AS01:342: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, "YCOR:AS01:342:STDZWF") } record(mbbo, "YCOR:AS01:342: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, "YCOR:AS01:342: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, "YCOR:AS01:342:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "YCOR:AS01:342: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, "YCOR:AS01:342: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, "YCOR:AS01:342: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, "YCOR:AS01:342:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "YCOR:AS01:342:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "YCOR:AS01:342:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "YCOR:AS01:342: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, "YCOR:AS01:342:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "YCOR:AS01:342:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "YCOR:AS01:342:STDZIMIN") } record(ao, "YCOR:AS01:342:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(VAL, "-6.0") field(FLNK, "YCOR:AS01:342:STDZIMAX") } record(ao, "YCOR:AS01:342:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(VAL, "6.0") field(FLNK, "YCOR:AS01:342:STDZIFINAL") } record(ao, "YCOR:AS01:342:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(VAL, "-6.0") field(FLNK, "YCOR:AS01:342: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, "YCOR:AS01:342: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, "YCOR:AS01:342:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "YCOR:AS01:342:STDZIMIN CP NMS") field(INPB, "YCOR:AS01:342:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "YCOR:AS01:342:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "YCOR:AS01:342:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "YCOR:AS01:342:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "YCOR:AS01:342:STDZIMIN CP NMS") field(INPB, "YCOR:AS01:342:STDZIMAX CP NMS") field(INPC, "YCOR:AS01:342:TRIMRAMPRATE CP NMS") field(INPD, "1.0") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "YCOR:AS01:342:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "YCOR:AS01:342:TRIMDLYPCT CP MS") field(INPB, "YCOR:AS01:342: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, "YCOR:AS01:342:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "YCOR:AS01:342: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, "YCOR:AS01:342:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "YCOR:AS01:342:IDES.HOPR") field(INPB, "YCOR:AS01:342:STDZMINIPCT CPP NMS") field(INPC, "YCOR:AS01:342:IDES.LOPR") field(PREC, "5") } record(calc, "YCOR:AS01:342:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "YCOR:AS01:342:IDES.HOPR") field(INPB, "YCOR:AS01:342:IDES.LOPR") field(INPC, "YCOR:AS01:342:STDZDIRECT.RVAL") field(INPD, "YCOR:AS01:342:STDZMINIDELTA") field(INPE, "YCOR:AS01:342:IDES") field(PREC, "5") field(FLNK, "YCOR:AS01:342: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, "YCOR:AS01:342:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "YCOR:AS01:342:IDES.HOPR") field(INPB, "YCOR:AS01:342:IDES.LOPR") field(INPC, "YCOR:AS01:342:STDZDIRECT.RVAL") field(INPD, "YCOR:AS01:342:STDZMINIDELTA") field(INPE, "YCOR:AS01:342: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, "YCOR:AS01:342: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, "YCOR:AS01:342:IADJUST.RVAL") field(INPB, "YCOR:AS01:342:STDZDIRECT.RVAL") field(INPC, "YCOR:AS01:342:STDZOK.RVAL") field(INPD, "YCOR:AS01:342:STDZDISABLE.RVAL") field(INPE, "YCOR:AS01:342:STATE.RVAL CPP NMS") field(INPF, "YCOR:AS01:342:ICTRL.RVAL") field(INPG, "YCOR:AS01:342:STATE.SEVR") field(INPH, "YCOR:AS01:342:BDELTAS.M") field(INPI, "YCOR:AS01:342:IACT.SEVR") field(OUT, "YCOR:AS01:342:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "YCOR:AS01:342:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "YCOR:AS01:342:STDZLOSTTOD.PROC") field(LNK2, "YCOR:AS01:342:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "YCOR:AS01:342:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "YCOR:AS01:342:CHECKPWRDIP_ENABLE") field(INPA, "YCOR:AS01:342:IACT CP") field(INPB, "YCOR:AS01:342:STDZIACTMAX") field(EGU, "A") field(FLNK, "YCOR:AS01:342: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, "YCOR:AS01:342:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "YCOR:AS01:342:CHECKPWRDIP_ENABLE") field(INPA, "YCOR:AS01:342:STDZIACTMAX") field(INPB, "YCOR:AS01:342:IACT") field(INPC, "YCOR:AS01:342:IDELTAS.I") field(OUT, "YCOR:AS01:342: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, "YCOR:AS01:342:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "YCOR:AS01:342:STDZOK.RVAL CP") field(INPB, "YCOR:AS01:342:STDZDISABLE.RVAL CP") field(INPC, "YCOR:AS01:342: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, "YCOR:AS01:342: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, "YCOR:AS01:342:CALBOK") { field(DESC, "Successful Calibration") field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "") 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, "YCOR:AS01:342:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "YCOR:AS01:342:CALBOK") field(INPB, "YCOR:AS01:342:CALBDISABLE") field(INPC, "YCOR:AS01:342:CALBSLOPE") field(OOPT, "On Change") field(OUT, "YCOR:AS01:342: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, "YCOR:AS01:342:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "YCOR:AS01:342: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, "YCOR:AS01:342:CALBSLOPE") field(DOL3, "YCOR:AS01:342:CALBOFFSET") field(DOL4, "0") field(DOL5, "0") field(LNK1, "MCOR:AS01:110:VSETPT.DISA PP NMS") field(LNK2, "MCOR:AS01:110:VSETPT.ASLO PP NMS") field(LNK3, "MCOR:AS01:110:VSETPT.AOFF PP NMS") field(LNK4, "MCOR:AS01:110:VSETPT.LINR PP NMS") field(LNK5, "MCOR:AS01:110:VSETPT.DISA PP NMS") # # 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, "MCOR:AS01:110:VSETPT.DISA PP NMS") field(LNK7, "MCOR:AS01:110:VSETPT.ASLO PP NMS") field(LNK8, "MCOR:AS01:110:VSETPT.AOFF PP NMS") field(LNK9, "MCOR:AS01:110:VSETPT.LINR PP NMS") field(LNKA, "MCOR:AS01:110:VSETPT.DISA PP NMS") } record(stringout, "YCOR:AS01:342:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "YCOR:AS01:342: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, "YCOR:AS01:342: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, "YCOR:AS01:342: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, "YCOR:AS01:342:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "YCOR:AS01:342: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, "YCOR:AS01:342:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "MCOR:AS01:110:VSETPT.ESLO") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "YCOR:AS01:342:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "YCOR:AS01:342:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "MCOR:AS01:110:VSETPT.EOFF") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "YCOR:AS01:342: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, "YCOR:AS01:342:CALCDAC") { field(DESC, "IACT to DAC Counts") field(CALC, "D=0?0:(((C*A)+B)-E)/D") field(INPA, "MCOR:AS01:110:I2VSLOPE") field(INPB, "0.0") field(INPC, "YCOR:AS01:342:IACT") field(INPD, "YCOR:AS01:342:DACSLOPE") field(INPE, "YCOR:AS01:342:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "YCOR:AS01:342:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "MCOR:AS01:110:VSETPT.RVAL CP") field(OMSL, "closed_loop") field(PREC, "6") field(PINI, "YES") } record(ao, "YCOR:AS01:342:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "6.0") field(HOPR, "6.0") field(DRVL, "-6.0") field(LOPR, "-6.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "YCOR:AS01:342:CALBIMAX") } record(ao, "YCOR:AS01:342:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "6.0") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVL, "-6.0") field(EGU, "A") field(VAL, "6.0") field(FLNK, "YCOR:AS01:342:CALBSTEPNUM") } record(ao, "YCOR:AS01:342:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "6.0") field(LOPR, "-6.0") field(VAL, "0") } record(longout, "YCOR:AS01:342: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, "YCOR:AS01:342:CALBIDELTA") } record(calc, "YCOR:AS01:342:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "YCOR:AS01:342:CALBIMAX") field(INPB, "YCOR:AS01:342:CALBIMIN") field(INPC, "YCOR:AS01:342: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, "YCOR:AS01:342:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "MCOR:AS01:110:ISETPT.DRVH") field(INPB, "MCOR:AS01:110:IACT.HOPR") field(INPC, "YCOR:AS01:342:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "YCOR:AS01:342:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "YCOR:AS01:342:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "YCOR:AS01:342:DACSA") } # Used only for xygraph edm plot record(subArray, "YCOR:AS01:342:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "YCOR:AS01:342: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, "YCOR:AS01:342:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "YCOR:AS01:342:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "YCOR:AS01:342:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "YCOR:AS01:342: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, "YCOR:AS01:342:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "YCOR:AS01:342:CALBYSA") } # Used only for xygraph edm plot record(subArray, "YCOR:AS01:342:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "YCOR:AS01:342:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "YCOR:AS01:342:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "YCOR:AS01:342:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "YCOR:AS01:342:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "YCOR:AS01:342:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "YCOR:AS01:342:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "YCOR:AS01:342: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, "YCOR:AS01:342:CALBSTEPNUM") field(INPB, "YCOR:AS01:342:CALBIACTWF") field(INPC, "YCOR:AS01:342: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, "YCOR:AS01:342: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, "YCOR:AS01:342:STDZITOL") field(INPH, "YCOR:AS01:342:DACSLOPE") field(INPI, "YCOR:AS01:342: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, "YCOR:AS01:342: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, "YCOR:AS01:342:CALBSTEPNUM") field(INPB, "YCOR:AS01:342:CALBIACTWF") field(INPC, "YCOR:AS01:342:DACWF") field(INPF, "YCOR:AS01:342: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 YCOR:AS01:342CALBOK 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, "YCOR:AS01:342:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "YCOR:AS01:342:DEGAUSIMIN.PROC PP") field(OUTB, "YCOR:AS01:342:DEGAUSIMAX.PROC PP") field(OUTC, "YCOR:AS01:342:DEGAUSTYPE.PROC PP") field(OUTD, "YCOR:AS01:342:DEGAUSSTEP.PROC PP") field(OUTE, "YCOR:AS01:342:MADNAME.PROC PP") field(OUTF, "YCOR:AS01:342:PSTYPE.PROC PP") field(OUTG, "YCOR:AS01:342: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, "YCOR:AS01:342:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "YCOR:AS01:342:DEGAUSIMIN NPP NMS") field(INPB, "YCOR:AS01:342:DEGAUSIMAX NPP NMS") field(INPC, "YCOR:AS01:342:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "YCOR:AS01:342:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "YCOR:AS01:342:PSTYPE NPP NMS") field(INPG, "YCOR:AS01:342:DEBUG.RVAL NPP NMS") field(INPH, "YCOR:AS01:342: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, "YCOR:AS01:342:DEGAUSWF PP") field(OUTB, "YCOR:AS01:342:DEGAUSMSG PP") field(OUTC, "YCOR:AS01:342: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, "YCOR:AS01:342:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"YCOR:AS01:342: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, "YCOR:AS01:342: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, "YCOR:AS01:342: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, "YCOR:AS01:342: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, "YCOR:AS01:342: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, "YCOR:AS01:342:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(VAL, "-6.0") } record(ao, "YCOR:AS01:342:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(VAL, "6.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,"YCOR:AS01:342: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, "YCOR:AS01:342: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,"YCOR:AS01:342: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, "YCOR:AS01:342: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, "YCOR:AS01:342: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, "YCOR:AS01:342: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, "YCOR:AS01:342:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "YCOR:AS01:342:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "YCOR:AS01:342:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "YCOR:AS01:342:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "YCOR:AS01:342: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, "YCOR:AS01:342:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "YCOR:AS01:342: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, "YCOR:AS01:342:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "YCOR:AS01:342:DEGAUS_IMAX") field(INPB, "YCOR:AS01:342:ISETPT") field(INPC, "YCOR:AS01:342:DEGAUSTYPE.RVAL") field(OUT, "YCOR:AS01:342:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "YCOR:AS01:342:DEGAUS_IMAX_UPDATE") } record(seq, "YCOR:AS01:342:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "YCOR:AS01:342:ISETPT") field(LNK1, "YCOR:AS01:342:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "YCOR:AS01:342:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "6.0") field(LOPR, "-6.0") field(DRVH, "6.0") field(DRVL, "-6.0") field(VAL, "6.0") field(FLNK, "YCOR:AS01:342:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "YCOR:AS01:342:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "YCOR:AS01:342:DEGAUS_IMAX") field(FLNK, "YCOR:AS01:342:DEGAUS_IMAXPOL") } record(bo, "YCOR:AS01:342:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "YCOR:AS01:342:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "YCOR:AS01:342: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, "YCOR:AS01:342:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "YCOR:AS01:342:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "6.0") field(LOPR, "-6.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "YCOR:AS01:342:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "YCOR:AS01:342:IACT") field(INPB, "YCOR:AS01:342:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "YCOR:AS01:342:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "YCOR:AS01:342:IACTPOL") } record(bo, "YCOR:AS01:342: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,"YCOR:AS01:342: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, "YCOR:AS01:342:DEGAUSENABLE CP") field(INPB, "YCOR:AS01:342:DEGAUSOK") field(INPC, "YCOR:AS01:342:STATE CP") field(INPD, "YCOR:AS01:342:STATE.SEVR") field(OUT, "YCOR:AS01:342:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "YCOR:AS01:342:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "YCOR:AS01:342:DEGAUS_STATE_CHECK") field(LNK1, "YCOR:AS01:342:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "YCOR:AS01:342:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "YCOR:AS01:342:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "YCOR:AS01:342: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, "YCOR:AS01:342:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "YCOR:AS01:342:DEGAUSOK.ZSV") field(LNK2, "YCOR:AS01:342: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, "YCOR:AS01:342:STATMSG.FRSV") field(LNK4, "YCOR:AS01:342: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, "YCOR:AS01:342:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "YCOR:AS01:342:DEGAUSOK.ZSV") field(LNK2, "YCOR:AS01:342: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, "YCOR:AS01:342:STATMSG.FRSV") field(LNK4, "YCOR:AS01:342: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, "YCOR:AS01:342:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "YCOR:AS01:342: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, "YCOR:AS01:342:STATMSG.FRSV") field(LNK3, "YCOR:AS01:342: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, "YCOR:AS01:342:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "YCOR:AS01:342: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, "YCOR:AS01:342:STATMSG.FRSV PP") field(LNK3, "YCOR:AS01:342:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "YCOR:AS01:342:FUNC") { field(DESC, "YCOR:AS01:342 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, "0") field(NIVL, "0") field(TEVL, "0") field(ELVL, "5") field(TVVL, "6") field(TTVL, "7") field(FTVL, "4") field(FFVL, "3") field(OUT, "YCOR:AS01:342:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "YCOR:AS01:342:CTRL") { field(DESC, "YCOR:AS01:342 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, "") field(TVST, "") field(TTST, "") 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, "0") field(TVVL, "0") field(TTVL, "0") field(FTVL, "0") field(FFVL, "0") field(OUT, "YCOR:AS01:342:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "YCOR:AS01:342:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "YCOR:AS01:342:BUSY") } # Set to FREE on IOC reboot record(bo, "YCOR:AS01:342:BUSY") { field(DESC, "YCOR:AS01:342 Ctrl Done") field(DOL, "YCOR:AS01:342:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "YCOR:AS01:342:SELECT") } record(bo, "YCOR:AS01:342:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "YCOR:AS01:342: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, "YCOR:AS01:342:CTRLSTATE") { field(DESC, "YCOR:AS01:342 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("YCOR:AS01:342:CTRL",20,20,0,0,"YCOR:AS01:342:CTRL") #! Field("YCOR:AS01:342:CTRL.OUT",16777215,1,"YCOR:AS01:342:CTRL.OUT") #! Link("YCOR:AS01:342:CTRL.OUT","YCOR:AS01:342:SELECTEN.A") #! Field("YCOR:AS01:342:CTRL.VAL",16777215,1,"YCOR:AS01:342:CTRL.VAL") #! Record("YCOR:AS01:342:SELECTEN",321,381,0,0,"YCOR:AS01:342:SELECTEN") #! Field("YCOR:AS01:342:SELECTEN.A",16777215,0,"YCOR:AS01:342:SELECTEN.A") #! Field("YCOR:AS01:342:SELECTEN.FLNK",16777215,1,"YCOR:AS01:342:SELECTEN.FLNK") #! Link("YCOR:AS01:342:SELECTEN.FLNK","YCOR:AS01:342:BUSY") #! Field("YCOR:AS01:342:SELECTEN.VAL",16777215,1,"YCOR:AS01:342:SELECTEN.VAL") #! Record("YCOR:AS01:342:BUSY",623,274,0,0,"YCOR:AS01:342:BUSY") #! Field("YCOR:AS01:342:BUSY.DOL",16777215,0,"YCOR:AS01:342:BUSY.DOL") #! Link("YCOR:AS01:342:BUSY.DOL","YCOR:AS01:342:SELECTEN.VAL") #! Field("YCOR:AS01:342:BUSY.FLNK",16777215,1,"YCOR:AS01:342:BUSY.FLNK") #! Link("YCOR:AS01:342:BUSY.FLNK","YCOR:AS01:342:SELECT") #! Record("YCOR:AS01:342:SELECT",669,508,0,1,"YCOR:AS01:342:SELECT") #! Record("YCOR:AS01:342:FUNC",940,120,0,0,"YCOR:AS01:342:FUNC") #! Field("YCOR:AS01:342:FUNC.OUT",16777215,0,"YCOR:AS01:342:FUNC.OUT") #! Link("YCOR:AS01:342:FUNC.OUT","YCOR:AS01:342:CTRL.VAL") #! Record("YCOR:AS01:342:ABORT",193,41,0,0,"YCOR:AS01:342:ABORT") #! Record("YCOR:AS01:342:CTRLSTATE",369,34,0,0,"YCOR:AS01:342: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,"YCOR:AS01:342:SELECT is used for Multi-device selection.\nIt is enabled when associated YCOR:AS01:342:CTRL is \"0\" (DONE).\nIt is disabled when associated YCOR:AS01:342: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,"YCOR:AS01:342: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, "YCOR:AS01:342:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "YCOR:AS01:342:BCTRL.SEVR") field(OUT, "YCOR:AS01:342: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, "YCOR:AS01:342:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "YCOR:AS01:342:BACT") field(INPB, "YCOR:AS01:342:POLYCOEF") field(INPC, "YCOR:AS01:342:POLYCOEF.A") field(INPD, "YCOR:AS01:342:POLYCOEF.B") field(INPE, "YCOR:AS01:342:IACT MS") field(INPF, "YCOR:AS01:342:BDELTAS PP") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "120.0") field(LOPR, "-120.0") field(HIHI, "120.0") field(LOLO, "-120.0") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "120.0") field(LOW, "-120.0") field(FLNK, "YCOR:AS01:342: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, "YCOR:AS01:342: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, "YCOR:AS01:342:BDES") field(INPB, "YCOR:AS01:342:TRIMBTOL") field(INPC, "YCOR:AS01:342:TRIMBTOLR") field(INPD, "YCOR:AS01:342:CHCKBTOL") field(INPE, "YCOR:AS01:342:CHCKBTOLR") field(F, "0.0") field(INPG, "30") field(INPH, "YCOR:AS01:342:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "YCOR:AS01:342:MPSBTOL") field(INPQ, "YCOR:AS01:342:MPSBTOLR") field(FLNK, "YCOR:AS01:342:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "YCOR:AS01:342:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "YCOR:AS01:342:BDES") field(INPB, "YCOR:AS01:342:BDELTAS.I") field(INPG, "YCOR:AS01:342:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "YCOR:AS01:342:BCON.HIGH") field(OUTB, "YCOR:AS01:342:BCON.LOW") field(OUTC, "YCOR:AS01:342:BCON.HIHI") field(OUTD, "YCOR:AS01:342:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "YCOR:AS01:342:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "YCOR:AS01:342:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "YCOR:AS01:342:BDIFF") field(LNK2, "YCOR:AS01:342:BADIFF") field(LNK3, "YCOR:AS01:342:BRATIO") field(LNK4, "YCOR:AS01:342:MPSLIMITS") field(LNK5, "YCOR:AS01:342:I2BSTATUS") field(LNK6, "YCOR:AS01:342:IACTFO.PROC") } record(calc, "YCOR:AS01:342:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "YCOR:AS01:342:BDES") field(INPB, "YCOR:AS01:342:BACT") field(EGU, "kG-m") field(PREC, "7") } record(calc, "YCOR:AS01:342:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "YCOR:AS01:342:BDIFF") field(EGU, "kG-m") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "YCOR:AS01:342:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "YCOR:AS01:342:BDIFF") field(INPB, "YCOR:AS01:342:BDES.HOPR") field(EGU, "kG-m") field(PREC, "7") } record(mbbi, "YCOR:AS01:342: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, "YCOR:AS01:342:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "YCOR:AS01:342:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "YCOR:AS01:342:BMON") field(INPB, "YCOR:AS01:342:POLYCOEF") field(INPC, "YCOR:AS01:342:POLYCOEF.A") field(INPD, "YCOR:AS01:342:POLYCOEF.B") field(INPE, "YCOR:AS01:342:IMON MS") field(INPF, "YCOR:AS01:342:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "120.0") field(LOPR, "-120.0") field(HIHI, "120.0") field(LOLO, "-120.0") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "120.0") field(LOW, "-120.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=MCOR:AS01:110:BDES CP record(ao, "YCOR:AS01:342:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "120.0") field(DRVL, "-120.0") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "7") field(EGU, "kG-m") field(MDEL, "-1") field(OMSL, "supervisory") # field(DOL, "") field(OUT, "YCOR:AS01:342:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "YCOR:AS01:342:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "YCOR:AS01:342:POLYCOEF") field(INPC, "YCOR:AS01:342:POLYCOEF.A") field(INPD, "YCOR:AS01:342:POLYCOEF.B") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "120.0") field(LOPR, "-120.0") field(MDEL, "-1") field(INPE, "YCOR:AS01:342:BDES.DRVH") field(INPF, "YCOR:AS01:342:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "YCOR:AS01:342:IDES") } record(sub, "YCOR:AS01:342:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "YCOR:AS01:342:POLYCOEF") field(INPC, "YCOR:AS01:342:POLYCOEF.A") field(INPD, "YCOR:AS01:342:POLYCOEF.B") field(INPE, "YCOR:AS01:342:BDES.DRVH") field(INPF, "YCOR:AS01:342:BDES.DRVL") field(EGU, "kG-m") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "7") field(VAL, "0.0") field(FLNK, "YCOR:AS01:342:INOM") } record(sub, "YCOR:AS01:342:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "YCOR:AS01:342:BDES.VAL") field(INPB, "YCOR:AS01:342:BDES.DRVH") field(INPC, "YCOR:AS01:342:BDES.DRVL") field(INPD, "YCOR:AS01:342:BDELTAS.I") field(INPE, "YCOR:AS01:342:BDELTAS.J") field(INPG, "YCOR:AS01:342:STATE") field(INPH, "YCOR:AS01:342:HSTA") field(EGU, "kG-m") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "YCOR:AS01:342:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "YCOR:AS01:342:BDES.VAL") field(INPB, "YCOR:AS01:342:BDES.DRVH") field(INPC, "YCOR:AS01:342:BDES.DRVL") field(INPD, "YCOR:AS01:342:BDELTAS.K") field(INPE, "YCOR:AS01:342:BDELTAS.L") field(INPG, "YCOR:AS01:342:STATE") field(INPH, "YCOR:AS01:342:HSTA") field(EGU, "kG-m") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "YCOR:AS01:342:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "YCOR:AS01:342:BLIMITS") field(LNK1, "YCOR:AS01:342:BACTLIMITS.F PP") field(DOL2, "YCOR:AS01:342:BACTLIMITS.I") field(LNK2, "YCOR:AS01:342:BACT.HIGH") field(DOL3, "YCOR:AS01:342:BACTLIMITS.J") field(LNK3, "YCOR:AS01:342:BACT.LOW") field(DOL4, "YCOR:AS01:342:BACTLIMITS.K") field(LNK4, "YCOR:AS01:342:BACT.HIHI") field(DOL5, "YCOR:AS01:342:BACTLIMITS.L") field(LNK5, "YCOR:AS01:342:BACT.LOLO") field(DOL6, "YCOR:AS01:342:BLIMITS") field(LNK6, "YCOR:AS01:342:BMONLIMITS.F PP") field(DOL7, "YCOR:AS01:342:BMONLIMITS.I") field(LNK7, "YCOR:AS01:342:BMON.HIGH") field(DOL8, "YCOR:AS01:342:BMONLIMITS.J") field(LNK8, "YCOR:AS01:342:BMON.LOW") field(DOL9, "YCOR:AS01:342:BMONLIMITS.K") field(LNK9, "YCOR:AS01:342:BMON.HIHI") field(DOLA, "YCOR:AS01:342:BMONLIMITS.L") field(LNKA, "YCOR:AS01:342:BMON.LOLO") field(FLNK, "YCOR:AS01:342:ILIMITS") field(SCAN, "5 second") } record(ao, "YCOR:AS01:342:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG-m") field(DRVH, "120.0") field(DRVL, "-120.0") field(HOPR, "120.0") field(LOPR, "-120.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, "YCOR:AS01:342: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, "YCOR:AS01:342:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "YCOR:AS01:342:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "YCOR:AS01:342:BCTRL.VAL") field(LNK2, "YCOR:AS01:342:BDES PP") field(DOL3, "1") field(LNK3, "YCOR:AS01:342:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "YCOR:AS01:342:CHECKSTDZLOST.PROC PP") field(DOL5, "YCOR:AS01:342:BCTRL.VAL") field(LNK5, "YCOR:AS01:342:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "YCOR:AS01:342:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "YCOR:AS01:342:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "YCOR:AS01:342:POLYCOEF") field(INPC, "YCOR:AS01:342:POLYCOEF.A") field(INPD, "YCOR:AS01:342:POLYCOEF.B") field(INPE, "YCOR:AS01:342:BDES.DRVH") field(INPF, "YCOR:AS01:342:BDES.DRVL") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "120.0") field(LOPR, "-120.0") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "YCOR:AS01:342:ISETPT") } record(ao, "YCOR:AS01:342:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "120.0") field(DRVL, "-120.0") field(EGU, "kG-m") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "YCOR:AS01:342:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "YC03S") } record(ai, "YCOR:AS01:342: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, "2021.318") } record(ao, "YCOR:AS01:342:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "120.0") field(DRVL, "-120.0") field(EGU, "kG-m") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "7") field(PINI, "YES") field(VAL, "120.0") field(FLNK, "YCOR:AS01:342:BSTEP") } record(ao, "YCOR:AS01:342:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "120.0") field(DRVL, "-120.0") field(EGU, "kG-m") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "7") field(PINI, "YES") field(VAL, "-120.0") field(FLNK, "YCOR:AS01:342:BSTEP") } record(ao, "YCOR:AS01:342:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "120.0") field(DRVL, "-120.0") field(EGU, "kG-m") field(HOPR, "120.0") field(LOPR, "-120.0") field(PINI, "YES") field(PREC, "7") } # This record is processed by YCOR:AS01:342: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, "YCOR:AS01:342:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVH, "120.0") field(DRVL, "-120.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, "YCOR:AS01:342:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "YCOR:AS01:342:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "YCOR:AS01:342:POLYCOEF") field(INPC, "YCOR:AS01:342:POLYCOEF.A") field(INPD, "YCOR:AS01:342:POLYCOEF.B") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "120.0") field(LOPR, "-120.0") field(MDEL, "-1") field(INPE, "YCOR:AS01:342:BCON.DRVH") field(INPF, "YCOR:AS01:342:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "YCOR:AS01:342: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, "YCOR:AS01:342:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "YCOR:AS01:342:BMAX") field(INPB, "YCOR:AS01:342:BMIN") field(INPC, "YCOR:AS01:342:BMIN.SEVR") field(INPD, "YCOR:AS01:342: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,"YCOR:AS01:342:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "YCOR:AS01:342:ONLINE CP") field(OUT, "YCOR:AS01:342:BCTRLDISABLEFOUT PP") } record(fanout, "YCOR:AS01:342:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "YCOR:AS01:342:BCTRLDISABLECALC") field(LNK1, "YCOR:AS01:342:BCTRLDISABLE") field(LNK2, "YCOR:AS01:342:BCTRLENABLE") } record(stringout, "YCOR:AS01:342:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "YCOR:AS01:342:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "YCOR:AS01:342:BCTRLDISV_UPDATE") } record(stringout, "YCOR:AS01:342:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "YCOR:AS01:342:BCTRL.ASG") field(VAL, "") field(FLNK, "YCOR:AS01:342:BCTRLDISV_UPDATE") } record(calcout, "YCOR:AS01:342:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "YCOR:AS01:342:ONLINE") field(OUT, "YCOR:AS01:342: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,"YCOR:AS01:342:BACT and MON\n are processed via links from \n YCOR:AS01:342:IACT (device raw value readback 1)\n and\n YCOR:AS01:342: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 YCOR:AS01:342:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = YCOR:AS01:342: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,"YCOR:AS01:342:BDES\n is processed when set by CA users or \n YCOR:AS01:342: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,"YCOR:AS01:342: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 YCOR:AS01:342: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 (YCOR:AS01:342: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,"YCOR:AS01:342:B*LIMITS and YCOR:AS01:342:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from YCOR:AS01:342: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,"YCOR:AS01:342: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,"YCOR:AS01:342: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, "YCOR:AS01:342: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, "YCOR:AS01:342:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG-m") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "YCOR:AS01:342:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "YCOR:AS01:342:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "120.0") field(DRVL, "-120.0") field(PINI, "YES") field(VAL, "120.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "YCOR:AS01:342:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "120.0") field(DRVL, "-120.0") field(PINI, "YES") field(VAL, "-120.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "YCOR:AS01:342:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "120.0") field(DRVL, "-120.0") field(PINI, "YES") field(VAL, "-120.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "YCOR:AS01:342:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "120.0") field(DRVL, "-120.0") field(PINI, "YES") field(VAL, "-120.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "YCOR:AS01:342: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, "YCOR:AS01:342:MPSLIMITS.E PP") } record(aSub, "YCOR:AS01:342: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, "YCOR:AS01:342:MPS.RVAL") field(INPB, "YCOR:AS01:342:BADIFF") field(INPC, "YCOR:AS01:342:BDELTAS.N") field(INPD, "YCOR:AS01:342:BACT") field(INPE, "YCOR:AS01:342:MPSBITMASK.RVAL") field(INPF, "YCOR:AS01:342:MPSBLLIM") field(INPG, "YCOR:AS01:342:MPSBMIN") field(INPH, "YCOR:AS01:342:MPSBMAX") field(INPI, "YCOR:AS01:342: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, "YCOR:AS01:342:INTOL.RVAL PP") field(OUTB, "YCOR:AS01:342:INTOL_BMIN.RVAL PP") field(OUTC, "YCOR:AS01:342:INTOL_BRANGE.RVAL PP") field(OUTD, "YCOR:AS01:342: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, "YCOR:AS01:342:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "YCOR:AS01:342:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "YCOR:AS01:342:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "YCOR:AS01:342:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "YCOR:AS01:342:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "YCOR:AS01:342:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "YCOR:AS01:342:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "YCOR:AS01:342: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, "YCOR:AS01:342:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "YCOR:AS01:342:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "YCOR:AS01:342:CHCKBTOL") field(INPB, "YCOR:AS01:342:POLYCOEF.B") field(PREC, "9") } record(calc, "YCOR:AS01:342: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, "YCOR:AS01:342:CHCKBTOL") field(FLNK, "YCOR:AS01:342:CHCKITOL") } record(calc, "YCOR:AS01:342:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "YCOR:AS01:342:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "YCOR:AS01:342:BDES.HOPR") field(INPB, "YCOR:AS01:342:STABILITY") field(INPC, "YCOR:AS01:342:BDES.LOPR") } record(longout, "YCOR:AS01:342:STABILITY") { field(DESC, "Long Term Stability") field(PINI, "YES") field(VAL, "1000") field(EGU, "ppm") field(DRVH, "3000") field(DRVL, "100") field(HOPR, "3000") field(LOPR, "100") field(FLNK, "YCOR:AS01:342:CHCKBTOL") } record(calc, "YCOR:AS01:342:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG-m") field(CALC, "ABS(A*B)") field(INPA, "YCOR:AS01:342:POLYCOEF.B") field(INPB, "YCOR:AS01:342:TRIMBTOL") field(PREC, "9") } record(ai, "YCOR:AS01:342:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "YCOR:AS01:342: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, "YCOR:AS01:342:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "YCOR:AS01:342:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "YCOR:AS01:342:PAUGO") } record(fanout, "YCOR:AS01:342:PAUGO") { field(DESC, "PAU control") field(LNK1, "YCOR:AS01:342:PAUSTOP") field(LNK2, "YCOR:AS01:342: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, "YCOR:AS01:342:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "YCOR:AS01:342:PAU.RVAL") field(DISV, "0") field(DOL1, "0") field(DOL2, "0") field(DOL3, "1") field(DLY3, "1") # field(LNK1, "MCOR:AS01:110:ISETPT.DISV") # field(LNK2, "MCOR:AS01:110:VSETPT.DISV") # field(LNK3, "ACTPAU PP") } record(seq, "YCOR:AS01:342:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "YCOR:AS01:342:PAU.RVAL") field(DISV, "1") field(DOL1, "1") field(DOL2, "1") field(DOL3, "0") # field(LNK1, "MCOR:AS01:110:ISETPT.DISV") # field(LNK2, "MCOR:AS01:110:VSETPT.DISV") # field(LNK3, "ACTPAU PP") } # Change attribute to PSDEVNAME record(stringout, "YCOR:AS01:342:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "MCOR:AS01:110:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "YCOR:AS01:342: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, "YCOR:AS01:342:PSTYPE.RVAL") field(INPC, "YCOR:AS01:342:TURNEDOFF.RVAL") field(INPD, "YCOR:AS01:342:CONFIG.RVAL") field(INPE, "YCOR:AS01:342:PSCATEGORY.RVAL") field(INPF, "YCOR:AS01:342:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "YCOR:AS01:342:AUTOCTRL.RVAL") field(INPJ, "YCOR:AS01:342:OUTOFSERVICE.RVAL") field(INPL, "YCOR:AS01:342:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "YCOR:AS01:342:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "YCOR:AS01:342:PAU") field(INPP, "YCOR:AS01:342:CALBDISABLE.RVAL") field(INPQ, "YCOR:AS01:342:PTRBDISABLE.RVAL") field(INPR, "YCOR:AS01:342:TRIMDISABLE.RVAL") field(INPS, "YCOR:AS01:342:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "YCOR:AS01:342:FBCK") field(INPU, "YCOR:AS01:342:TRIMTYPE.RVAL") field(INPV, "YCOR:AS01:342:STDZDIRECT.RVAL") field(INPW, "YCOR:AS01:342:DEGAUSENABLE.RVAL") field(FLNK, "YCOR:AS01:342:HSTA") } record(longin, "YCOR:AS01:342:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "YCOR:AS01:342:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "YCOR:AS01:342: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, "YCOR:AS01:342: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, "YCOR:AS01:342: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, "YCOR:AS01:342: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, "YCOR:AS01:342: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, "YCOR:AS01:342: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 YCOR:AS01:342:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses YCOR:AS01:342:FBCK. # This PV should be replaced by YCOR:AS01:342: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, "YCOR:AS01:342: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, "YCOR:AS01:342: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, "YCOR:AS01:342: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, "YCOR:AS01:342:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"YCOR:AS01:342:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "YCOR:AS01:342:OUTOFSERVICE NPP NMS") field(OUT, "YCOR:AS01:342:ONLINE PP") } record(bo, "YCOR:AS01:342:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "YCOR:AS01:342: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, "YCOR:AS01:342: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, "YCOR:AS01:342: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, "YCOR:AS01:342: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, "YCOR:AS01:342: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, "YCOR:AS01:342: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, "YCOR:AS01:342: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, "YCOR:AS01:342: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, "YCOR:AS01:342: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, "0") field(ASG, "NOWRITE") } record(mbbo, "YCOR:AS01:342: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, "0") field(ASG, "NOWRITE") } record(mbbo, "YCOR:AS01:342: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, "YCOR:AS01:342:TRIMTYPE") } record(stringout, "YCOR:AS01:342:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "YCOR:AS01:342:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "YCOR:AS01:342:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "YCOR:AS01:342:STATE.RVAL") field(INPB, "YCOR:AS01:342:INTLKSUMY.RVAL") field(OUT, "YCOR:AS01:342:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "YCOR:AS01:342: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, "YCOR:AS01:342:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "YCOR:AS01:342:STATE.RVAL") field(INPB, "YCOR:AS01:342:INTLKSUMY.RVAL") field(OUT, "YCOR:AS01:342:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "YCOR:AS01:342:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "YCOR:AS01:342:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "YCOR:AS01:342: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, "YCOR:AS01:342: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, "YCOR:AS01:342: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, "YCOR:AS01:342: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,"YCOR:AS01:342: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("YCOR:AS01:342:TURNEDOFF",3140,1907,0,1,"YCOR:AS01:342:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "YCOR:AS01:342:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "YCOR:AS01:342:BACT.STAT") field(INPB, "YCOR:AS01:342:BDES.STAT") field(INPC, "YCOR:AS01:342:IRIPL.STAT") field(INPD, "MCOR:AS01:110:VSETPT.STAT") field(INPE, "MCOR:AS01:110:VACT.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, "YCOR:AS01:342:BACT.SEVR") field(INPH, "YCOR:AS01:342:BDES.SEVR") field(INPI, "YCOR:AS01:342:IRIPL.SEVR") field(INPJ, "MCOR:AS01:110:VSETPT.SEVR") field(INPK, "MCOR:AS01:110:VACT.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, "YCOR:AS01:342:STATE.RVAL") field(INPN, "YCOR:AS01:342:STDZOK") field(INPO, "YCOR:AS01:342:CALBOK") field(INPP, "YCOR:AS01:342:OUTOFSERVICE.RVAL") field(INPQ, "YCOR:AS01:342:CONFIG.RVAL") field(INPR, "YCOR:AS01:342:HSTA") field(INPS, "YCOR:AS01:342:CTRL.RVAL") field(INPT, "YCOR:AS01:342:DEGAUSOK") field(INPV, "YCOR:AS01:342: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, "YCOR:AS01:342:STAT") } record(longout, "YCOR:AS01:342:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "YCOR:AS01:342:STATCTRLSUB") field(DOL, "YCOR:AS01:342:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "YCOR:AS01:342:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "YCOR:AS01:342:STAT") field(INPB, "YCOR:AS01:342:HSTA") field(INPD, "YCOR:AS01:342:ONOFFCTRL.RVAL") field(FLNK, "YCOR:AS01:342:STATMSG") } record(mbbo, "YCOR:AS01:342: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, "YCOR:AS01:342:UNAVAILGO") field(DOL, "YCOR:AS01:342:STATCTRLSUB.W") } record(seq, "YCOR:AS01:342:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "YCOR:AS01:342:STATSUB.U") field(LNK1, "YCOR:AS01:342:UNAVAIL PP") } record(stringout, "YCOR:AS01:342:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"YCOR:AS01:342:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - YCOR:AS01:342:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - YCOR:AS01:342: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,"YCOR:AS01:342STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - YCOR:AS01:342:STATUS\nC - YCOR:AS01:342:ON\nD - YCOR:AS01:342:STDZOK\nE - YCOR:AS01:342:CALBOK\nF - YCOR:AS01:342:BACTDRIFT (future)\nG -\nH- YCOR:AS01:342:DACSTATUS\nI -YCOR:AS01:342:ADCSTATUS\nJ - YCOR:AS01:342:BACTSTATUS\nK - YCOR:AS01:342:BDESSTATUS\nL - YCOR:AS01:342:RIPLSTATUS\n\nOutput:\nP - YCOR:AS01:342: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, "YCOR:AS01:342: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, "YCOR:AS01:342: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, "YCOR:AS01:342: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, "YCOR:AS01:342: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 # Note: for slave with trim coils # set the macro ACT to the following: # ACT=:IACTCALC record(ai, "LGPS:AS01:1:IACT") { field(DESC, "Current") field(INP, "PS:AS01: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:AS01:1:BACT") info(autosaveFields,"HYST") } record(bi, "LGPS:AS01:1:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "PS:AS01:1:STATE CP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "LGPS:AS01: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:AS01:1:BDELTAS") field(DRVH, "50.0") field(DRVL, "0.0") field(DOL, "LGPS:AS01: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:AS01:1:ICTRL PP") } # This record is processed by LGPS:AS01:1:ICON") # Note: we are not setting alarms here. record(ao, "LGPS:AS01: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:AS01:1:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "LGPS:AS01:1:INOM") { field(DESC, "Nominal Current") field(DOL, "LGPS:AS01: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:AS01: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:AS01:1:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "LGPS:AS01:1:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "LGPS:AS01:1:ISETPT.OMSL") field(DOL2, "LGPS:AS01:1:ICTRL") field(LNK2, "LGPS:AS01:1:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "LGPS:AS01:1:ISETPT.OMSL") } record(ao, "LGPS:AS01: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:AS01:1:IMIN") } record(ao, "LGPS:AS01: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:AS01:1:IRANGE") } record(sel, "LGPS:AS01:1:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(NVL, "LGPS:AS01:1:BACT.SEVR") field(INPA, "LGPS:AS01:1:IACT NPP MS") field(INPB, "LGPS:AS01:1:IACTPREVOK NPP MS") field(INPC, "LGPS:AS01:1:IACTPREVOK NPP MS") field(INPD, "LGPS:AS01:1:IACTPREVOK NPP MS") } record(sub, "LGPS:AS01:1:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "LGPS:AS01:1:IDES") field(INPB, "LGPS:AS01:1:ISETPT.DRVH") field(INPC, "LGPS:AS01:1:ISETPT.DRVL") field(INPD, "LGPS:AS01:1:IDELTAS.I") field(INPE, "LGPS:AS01:1:IDELTAS.J") field(INPG, "LGPS:AS01:1:STATE") field(INPH, "LGPS:AS01:1:HSTA") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "LGPS:AS01:1:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "LGPS:AS01:1:IDES") field(INPB, "LGPS:AS01:1:ISETPT.DRVH") field(INPC, "LGPS:AS01:1:ISETPT.DRVL") field(INPD, "LGPS:AS01:1:IDELTAS.K") field(INPE, "LGPS:AS01:1:IDELTAS.L") field(INPG, "LGPS:AS01:1:STATE") field(INPH, "LGPS:AS01:1:HSTA") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "LGPS:AS01:1:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "LGPS:AS01:1:BLIMITS") field(LNK1, "LGPS:AS01:1:IACTLIMITS.F PP") field(DOL2, "LGPS:AS01:1:IACTLIMITS.I") field(LNK2, "LGPS:AS01:1:IACT.HIGH") field(DOL3, "LGPS:AS01:1:IACTLIMITS.J") field(LNK3, "LGPS:AS01:1:IACT.LOW") field(DOL4, "LGPS:AS01:1:IACTLIMITS.K") field(LNK4, "LGPS:AS01:1:IACT.HIHI") field(DOL5, "LGPS:AS01:1:IACTLIMITS.L") field(LNK5, "LGPS:AS01:1:IACT.LOLO") field(DOL6, "LGPS:AS01:1:BLIMITS") field(LNK6, "LGPS:AS01:1:IMONLIMITS.F PP") field(DOL7, "LGPS:AS01:1:IMONLIMITS.I") field(LNK7, "LGPS:AS01:1:IMON.HIGH") field(DOL8, "LGPS:AS01:1:IMONLIMITS.J") field(LNK8, "LGPS:AS01:1:IMON.LOW") field(DOL9, "LGPS:AS01:1:IMONLIMITS.K") field(LNK9, "LGPS:AS01:1:IMON.HIHI") field(DOLA, "LGPS:AS01:1:IMONLIMITS.L") field(LNKA, "LGPS:AS01: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:AS01:1:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "LGPS:AS01:1:TRIMBTOL") field(INPE, "LGPS:AS01:1:CHCKBTOL") field(INPF, "LGPS:AS01:1:BDELTAS.K") field(INPG, "LGPS:AS01:1:BDELTAS.L") field(INPH, "LGPS:AS01: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:AS01:1:STDZITOLR") field(INPC, "LGPS:AS01:1:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = PS:AS01: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:AS01:1:STATESETPT") { field(DESC, "PS On/Off") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(OUT, "PS:AS01: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:AS01:1:RESET PP # record(bo, "LGPS:AS01: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:AS01:1:RESET PP") } record(bo, "LGPS:AS01:1:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "PS:AS01: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:AS01: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:AS01:1:TRIMRAMPRATE") field(OUT, "") field(FLNK, "LGPS:AS01:1:STDZDLY") } record(ao, "LGPS:AS01: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:AS01:1:ISETPT PP") field(DOL, "LGPS:AS01: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:AS01: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:AS01:1:BMON") } record(ao, "LGPS:AS01: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:AS01:1:IRIPLOK") } record(sub, "LGPS:AS01:1:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "LGPS:AS01:1:IRIPL.VAL") field(INPB, "LGPS:AS01: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:AS01: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:AS01:1:IGND") { field(DESC, "Ground Current") field(EGU, "Volts") field(PREC, "6") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") } record(bi, "LGPS:AS01:1:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "PS:AS01:1:INTLKSUMY CP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "LGPS:AS01: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:AS01:1:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "LGPS:AS01:1:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "LGPS:AS01:1:IACTPREVOK") field(LNK2, "LGPS:AS01:1:IDIFF") field(LNK3, "LGPS:AS01:1:IADIFF") field(LNK4, "LGPS:AS01:1:IRATIO") field(LNK5, "LGPS:AS01:1:IDIRECT") field(LNK6, "LGPS:AS01:1:IACTPOL_CHECK") } record(calc, "LGPS:AS01:1:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "LGPS:AS01:1:IDES") field(INPB, "LGPS:AS01:1:IACT") field(EGU, "Volts") field(PREC, "9") field(HOPR, "50.0") field(LOPR, "0.0") } record(calc, "LGPS:AS01:1:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "LGPS:AS01:1:IDIFF") field(PREC, "9") } record(calc, "LGPS:AS01:1:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "LGPS:AS01:1:IDIFF") field(INPB, "LGPS:AS01:1:IDES.DRVH") field(PREC, "9") } record(calcout, "LGPS:AS01:1:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "LGPS:AS01:1:IMIN") field(INPB, "LGPS:AS01: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:AS01: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:AS01:1:IACT") field(FLNK, "LGPS:AS01:1:IACTPOL") } record(bo, "LGPS:AS01:1:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "LGPS:AS01: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:AS01:1:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from LGPS:AS01:1:IDELTAS and the\n LGPS:AS01: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:AS01:1:IACT: \n Get copy of LGPS:AS01:1:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"LGPS:AS01: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:AS01:1:IDES:\n Contains raw value calculated by \nLGPS:AS01: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:AS01:1:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"LGPS:AS01: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:AS01: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:AS01: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:AS01:1:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by LGPS:AS01: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:AS01:1:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n LGPS:AS01: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:AS01:1:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "LGPS:AS01:1:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "LGPS:AS01:1:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "LGPS:AS01:1:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "LGPS:AS01:1:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "LGPS:AS01:1:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "LGPS:AS01: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:AS01:1:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "LGPS:AS01:1:TRIMTYPE.RVAL") field(INPB, "LGPS:AS01:1:CONFIG.RVAL") field(OUT, "LGPS:AS01:1:TRIMMAXNUM PP") } record(longout, "LGPS:AS01: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:AS01: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:AS01:1:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "LGPS:AS01: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:AS01: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:AS01: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:AS01: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:AS01: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:AS01: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:AS01:1:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "LGPS:AS01: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:AS01: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:AS01:1:IMOVE") field(INPB, "LGPS:AS01:1:IACT") field(INPC, "LGPS:AS01:1:IRAMPRATE") field(INPD, "1.577") field(INPE, "LGPS:AS01:1:TRIMDLYPCT") field(INPF, "LGPS:AS01:1:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "LGPS:AS01:1:RAMPTIME_LEFT PP") } record(longout, "LGPS:AS01:1:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "LGPS:AS01:1:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "LGPS:AS01:1:RAMPDONE_CALC") } record(calc, "LGPS:AS01:1:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "LGPS:AS01:1:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "LGPS:AS01:1:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "LGPS:AS01: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:AS01:1:RAMPTIME_LEFT") field(OUT, "LGPS:AS01:1:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "LGPS:AS01:1:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "LGPS:AS01:1:RAMPTIME_LEFT NMS") field(OUT, "LGPS:AS01:1:RAMPDONE PP") } record(bo, "LGPS:AS01:1:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "LGPS:AS01:1:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "LGPS:AS01: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:AS01: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:AS01:1:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "LGPS:AS01:1:DEBUG.PROC PP") field(LNK2, "LGPS:AS01:1:STDZCYCLENUM.PROC PP") field(LNK3, "LGPS:AS01:1:STDZDISABLE.PROC PP") field(LNK4, "LGPS:AS01: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:AS01:1:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "LGPS:AS01:1:STDZIMIN NPP NMS") field(INPB, "LGPS:AS01:1:STDZIMAX NPP NMS") field(INPC, "LGPS:AS01:1:STDZIFINAL NPP NMS") field(INPD, "LGPS:AS01:1:STDZCYCLENUM NPP NMS") field(INPE, "LGPS:AS01:1:STDZDIRECT.RVAL NPP NMS") field(INPF, "LGPS:AS01:1:STDZDISABLE.RVAL CPP NMS") field(INPG, "LGPS:AS01: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:AS01:1:STDZWF PP") field(OUTB, "LGPS:AS01: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:AS01:1:STDZWF") } record(mbbo, "LGPS:AS01: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:AS01: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:AS01: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:AS01: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:AS01: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:AS01: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:AS01:1:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "LGPS:AS01:1:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "LGPS:AS01:1:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "LGPS:AS01: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:AS01:1:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "LGPS:AS01:1:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "LGPS:AS01:1:STDZIMIN") } record(ao, "LGPS:AS01: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:AS01:1:STDZIMAX") } record(ao, "LGPS:AS01: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:AS01:1:STDZIFINAL") } record(ao, "LGPS:AS01: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:AS01: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:AS01: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:AS01:1:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "LGPS:AS01:1:STDZIMIN CP NMS") field(INPB, "LGPS:AS01:1:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "LGPS:AS01:1:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "LGPS:AS01:1:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "LGPS:AS01:1:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "LGPS:AS01:1:STDZIMIN CP NMS") field(INPB, "LGPS:AS01:1:STDZIMAX CP NMS") field(INPC, "LGPS:AS01:1:TRIMRAMPRATE CP NMS") field(INPD, "1.0") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "LGPS:AS01:1:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "LGPS:AS01:1:TRIMDLYPCT CP MS") field(INPB, "LGPS:AS01: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:AS01: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:AS01: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:AS01:1:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "LGPS:AS01:1:IDES.HOPR") field(INPB, "LGPS:AS01:1:STDZMINIPCT CPP NMS") field(INPC, "LGPS:AS01:1:IDES.LOPR") field(PREC, "5") } record(calc, "LGPS:AS01:1:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "LGPS:AS01:1:IDES.HOPR") field(INPB, "LGPS:AS01:1:IDES.LOPR") field(INPC, "LGPS:AS01:1:STDZDIRECT.RVAL") field(INPD, "LGPS:AS01:1:STDZMINIDELTA") field(INPE, "LGPS:AS01:1:IDES") field(PREC, "5") field(FLNK, "LGPS:AS01: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:AS01:1:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "LGPS:AS01:1:IDES.HOPR") field(INPB, "LGPS:AS01:1:IDES.LOPR") field(INPC, "LGPS:AS01:1:STDZDIRECT.RVAL") field(INPD, "LGPS:AS01:1:STDZMINIDELTA") field(INPE, "LGPS:AS01: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:AS01: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:AS01:1:IADJUST.RVAL") field(INPB, "LGPS:AS01:1:STDZDIRECT.RVAL") field(INPC, "LGPS:AS01:1:STDZOK.RVAL") field(INPD, "LGPS:AS01:1:STDZDISABLE.RVAL") field(INPE, "LGPS:AS01:1:STATE.RVAL CPP NMS") field(INPF, "LGPS:AS01:1:ICTRL.RVAL") field(INPG, "LGPS:AS01:1:STATE.SEVR") field(INPH, "LGPS:AS01:1:BDELTAS.M") field(INPI, "LGPS:AS01:1:IACT.SEVR") field(OUT, "LGPS:AS01:1:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "LGPS:AS01:1:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "LGPS:AS01:1:STDZLOSTTOD.PROC") field(LNK2, "LGPS:AS01: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:AS01:1:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "LGPS:AS01:1:CHECKPWRDIP_ENABLE") field(INPA, "LGPS:AS01:1:IACT CP") field(INPB, "LGPS:AS01:1:STDZIACTMAX") field(EGU, "A") field(FLNK, "LGPS:AS01: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:AS01:1:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "LGPS:AS01:1:CHECKPWRDIP_ENABLE") field(INPA, "LGPS:AS01:1:STDZIACTMAX") field(INPB, "LGPS:AS01:1:IACT") field(INPC, "LGPS:AS01:1:IDELTAS.I") field(OUT, "LGPS:AS01: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:AS01:1:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "LGPS:AS01:1:STDZOK.RVAL CP") field(INPB, "LGPS:AS01:1:STDZDISABLE.RVAL CP") field(INPC, "LGPS:AS01: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:AS01: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:AS01: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:AS01:1:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "LGPS:AS01:1:CALBOK") field(INPB, "LGPS:AS01:1:CALBDISABLE") field(INPC, "LGPS:AS01:1:CALBSLOPE") field(OOPT, "On Change") field(OUT, "LGPS:AS01: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:AS01:1:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "LGPS:AS01: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:AS01:1:CALBSLOPE") field(DOL3, "LGPS:AS01: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:AS01: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:AS01: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:AS01: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:AS01: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:AS01:1:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "LGPS:AS01: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:AS01: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:AS01:1:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "LGPS:AS01: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:AS01: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:AS01: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:AS01:1:IACT") field(INPD, "LGPS:AS01:1:DACSLOPE") field(INPE, "LGPS:AS01:1:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "LGPS:AS01:1:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "supervisory") field(PREC, "6") field(PINI, "YES") } record(ao, "LGPS:AS01: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:AS01:1:CALBIMAX") } record(ao, "LGPS:AS01: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:AS01:1:CALBSTEPNUM") } record(ao, "LGPS:AS01: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:AS01: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:AS01:1:CALBIDELTA") } record(calc, "LGPS:AS01:1:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "LGPS:AS01:1:CALBIMAX") field(INPB, "LGPS:AS01:1:CALBIMIN") field(INPC, "LGPS:AS01: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:AS01:1:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "PS:AS01:1:ISETPT.DRVH") field(INPB, "PS:AS01:1:IACT.HOPR") field(INPC, "LGPS:AS01:1:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "LGPS:AS01:1:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "LGPS:AS01:1:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "LGPS:AS01:1:DACSA") } # Used only for xygraph edm plot record(subArray, "LGPS:AS01:1:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "LGPS:AS01: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:AS01:1:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "LGPS:AS01:1:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "LGPS:AS01:1:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "LGPS:AS01: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:AS01:1:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "LGPS:AS01:1:CALBYSA") } # Used only for xygraph edm plot record(subArray, "LGPS:AS01:1:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "LGPS:AS01:1:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "LGPS:AS01:1:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "LGPS:AS01:1:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "LGPS:AS01:1:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "LGPS:AS01:1:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "LGPS:AS01:1:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "LGPS:AS01: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:AS01:1:CALBSTEPNUM") field(INPB, "LGPS:AS01:1:CALBIACTWF") field(INPC, "LGPS:AS01: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:AS01: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:AS01:1:STDZITOL") field(INPH, "LGPS:AS01:1:DACSLOPE") field(INPI, "LGPS:AS01: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:AS01: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:AS01:1:CALBSTEPNUM") field(INPB, "LGPS:AS01:1:CALBIACTWF") field(INPC, "LGPS:AS01:1:DACWF") field(INPF, "LGPS:AS01: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:AS01: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:AS01:1:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "LGPS:AS01:1:DEGAUSIMIN.PROC PP") field(OUTB, "LGPS:AS01:1:DEGAUSIMAX.PROC PP") field(OUTC, "LGPS:AS01:1:DEGAUSTYPE.PROC PP") field(OUTD, "LGPS:AS01:1:DEGAUSSTEP.PROC PP") field(OUTE, "LGPS:AS01:1:MADNAME.PROC PP") field(OUTF, "LGPS:AS01:1:PSTYPE.PROC PP") field(OUTG, "LGPS:AS01: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:AS01:1:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "LGPS:AS01:1:DEGAUSIMIN NPP NMS") field(INPB, "LGPS:AS01:1:DEGAUSIMAX NPP NMS") field(INPC, "LGPS:AS01:1:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "LGPS:AS01:1:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "LGPS:AS01:1:PSTYPE NPP NMS") field(INPG, "LGPS:AS01:1:DEBUG.RVAL NPP NMS") field(INPH, "LGPS:AS01: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:AS01:1:DEGAUSWF PP") field(OUTB, "LGPS:AS01:1:DEGAUSMSG PP") field(OUTC, "LGPS:AS01: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:AS01:1:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"LGPS:AS01: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:AS01: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:AS01: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:AS01: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:AS01: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:AS01: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:AS01: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:AS01: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:AS01: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:AS01: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:AS01: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:AS01: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:AS01: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:AS01:1:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "LGPS:AS01:1:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "LGPS:AS01:1:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "LGPS:AS01:1:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "LGPS:AS01: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:AS01: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:AS01: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:AS01:1:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "LGPS:AS01:1:DEGAUS_IMAX") field(INPB, "LGPS:AS01:1:ISETPT") field(INPC, "LGPS:AS01:1:DEGAUSTYPE.RVAL") field(OUT, "LGPS:AS01:1:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "LGPS:AS01:1:DEGAUS_IMAX_UPDATE") } record(seq, "LGPS:AS01:1:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "LGPS:AS01:1:ISETPT") field(LNK1, "LGPS:AS01:1:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "LGPS:AS01: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:AS01:1:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "LGPS:AS01:1:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "LGPS:AS01:1:DEGAUS_IMAX") field(FLNK, "LGPS:AS01:1:DEGAUS_IMAXPOL") } record(bo, "LGPS:AS01:1:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "LGPS:AS01:1:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "LGPS:AS01: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:AS01:1:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "LGPS:AS01: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:AS01: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:AS01:1:IACT") field(INPB, "LGPS:AS01:1:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "LGPS:AS01:1:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "LGPS:AS01:1:IACTPOL") } record(bo, "LGPS:AS01: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:AS01: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:AS01:1:DEGAUSENABLE CP") field(INPB, "LGPS:AS01:1:DEGAUSOK") field(INPC, "LGPS:AS01:1:STATE CP") field(INPD, "LGPS:AS01:1:STATE.SEVR") field(OUT, "LGPS:AS01:1:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "LGPS:AS01:1:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "LGPS:AS01:1:DEGAUS_STATE_CHECK") field(LNK1, "LGPS:AS01:1:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "LGPS:AS01:1:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "LGPS:AS01:1:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "LGPS:AS01: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:AS01:1:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "LGPS:AS01:1:DEGAUSOK.ZSV") field(LNK2, "LGPS:AS01: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:AS01:1:STATMSG.FRSV") field(LNK4, "LGPS:AS01: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:AS01:1:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "LGPS:AS01:1:DEGAUSOK.ZSV") field(LNK2, "LGPS:AS01: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:AS01:1:STATMSG.FRSV") field(LNK4, "LGPS:AS01: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:AS01:1:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "LGPS:AS01: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:AS01:1:STATMSG.FRSV") field(LNK3, "LGPS:AS01: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:AS01:1:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "LGPS:AS01: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:AS01:1:STATMSG.FRSV PP") field(LNK3, "LGPS:AS01:1:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "LGPS:AS01:1:FUNC") { field(DESC, "LGPS:AS01: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:AS01:1:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "LGPS:AS01:1:CTRL") { field(DESC, "LGPS:AS01: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:AS01:1:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "LGPS:AS01:1:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "LGPS:AS01:1:BUSY") } # Set to FREE on IOC reboot record(bo, "LGPS:AS01:1:BUSY") { field(DESC, "LGPS:AS01:1 Ctrl Done") field(DOL, "LGPS:AS01:1:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "LGPS:AS01:1:SELECT") } record(bo, "LGPS:AS01:1:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "LGPS:AS01: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:AS01:1:CTRLSTATE") { field(DESC, "LGPS:AS01: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:AS01:1:CTRL",20,20,0,0,"LGPS:AS01:1:CTRL") #! Field("LGPS:AS01:1:CTRL.OUT",16777215,1,"LGPS:AS01:1:CTRL.OUT") #! Link("LGPS:AS01:1:CTRL.OUT","LGPS:AS01:1:SELECTEN.A") #! Field("LGPS:AS01:1:CTRL.VAL",16777215,1,"LGPS:AS01:1:CTRL.VAL") #! Record("LGPS:AS01:1:SELECTEN",321,381,0,0,"LGPS:AS01:1:SELECTEN") #! Field("LGPS:AS01:1:SELECTEN.A",16777215,0,"LGPS:AS01:1:SELECTEN.A") #! Field("LGPS:AS01:1:SELECTEN.FLNK",16777215,1,"LGPS:AS01:1:SELECTEN.FLNK") #! Link("LGPS:AS01:1:SELECTEN.FLNK","LGPS:AS01:1:BUSY") #! Field("LGPS:AS01:1:SELECTEN.VAL",16777215,1,"LGPS:AS01:1:SELECTEN.VAL") #! Record("LGPS:AS01:1:BUSY",623,274,0,0,"LGPS:AS01:1:BUSY") #! Field("LGPS:AS01:1:BUSY.DOL",16777215,0,"LGPS:AS01:1:BUSY.DOL") #! Link("LGPS:AS01:1:BUSY.DOL","LGPS:AS01:1:SELECTEN.VAL") #! Field("LGPS:AS01:1:BUSY.FLNK",16777215,1,"LGPS:AS01:1:BUSY.FLNK") #! Link("LGPS:AS01:1:BUSY.FLNK","LGPS:AS01:1:SELECT") #! Record("LGPS:AS01:1:SELECT",669,508,0,1,"LGPS:AS01:1:SELECT") #! Record("LGPS:AS01:1:FUNC",940,120,0,0,"LGPS:AS01:1:FUNC") #! Field("LGPS:AS01:1:FUNC.OUT",16777215,0,"LGPS:AS01:1:FUNC.OUT") #! Link("LGPS:AS01:1:FUNC.OUT","LGPS:AS01:1:CTRL.VAL") #! Record("LGPS:AS01:1:ABORT",193,41,0,0,"LGPS:AS01:1:ABORT") #! Record("LGPS:AS01:1:CTRLSTATE",369,34,0,0,"LGPS:AS01: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:AS01:1:SELECT is used for Multi-device selection.\nIt is enabled when associated LGPS:AS01:1:CTRL is \"0\" (DONE).\nIt is disabled when associated LGPS:AS01: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:AS01: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:AS01:1:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "LGPS:AS01:1:BCTRL.SEVR") field(OUT, "LGPS:AS01: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:AS01:1:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "LGPS:AS01:1:BACT") field(INPB, "LGPS:AS01:1:POLYCOEF") field(INPC, "LGPS:AS01:1:POLYCOEF.A") field(INPD, "LGPS:AS01:1:POLYCOEF.B") field(INPE, "LGPS:AS01:1:IACT MS") field(INPF, "LGPS:AS01: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:AS01: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:AS01: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:AS01:1:BDES") field(INPB, "LGPS:AS01:1:TRIMBTOL") field(INPC, "LGPS:AS01:1:TRIMBTOLR") field(INPD, "LGPS:AS01:1:CHCKBTOL") field(INPE, "LGPS:AS01:1:CHCKBTOLR") field(F, "0.0") field(INPG, "30") field(INPH, "LGPS:AS01:1:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "LGPS:AS01:1:MPSBTOL") field(INPQ, "LGPS:AS01:1:MPSBTOLR") field(FLNK, "LGPS:AS01:1:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "LGPS:AS01:1:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "LGPS:AS01:1:BDES") field(INPB, "LGPS:AS01:1:BDELTAS.I") field(INPG, "LGPS:AS01:1:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "LGPS:AS01:1:BCON.HIGH") field(OUTB, "LGPS:AS01:1:BCON.LOW") field(OUTC, "LGPS:AS01:1:BCON.HIHI") field(OUTD, "LGPS:AS01:1:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "LGPS:AS01:1:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "LGPS:AS01:1:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "LGPS:AS01:1:BDIFF") field(LNK2, "LGPS:AS01:1:BADIFF") field(LNK3, "LGPS:AS01:1:BRATIO") field(LNK4, "LGPS:AS01:1:MPSLIMITS") field(LNK5, "LGPS:AS01:1:I2BSTATUS") field(LNK6, "LGPS:AS01:1:IACTFO.PROC") } record(calc, "LGPS:AS01:1:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "LGPS:AS01:1:BDES") field(INPB, "LGPS:AS01:1:BACT") field(EGU, "Volts") field(PREC, "7") } record(calc, "LGPS:AS01:1:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "LGPS:AS01:1:BDIFF") field(EGU, "Volts") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "LGPS:AS01:1:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "LGPS:AS01:1:BDIFF") field(INPB, "LGPS:AS01:1:BDES.HOPR") field(EGU, "Volts") field(PREC, "7") } record(mbbi, "LGPS:AS01: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:AS01:1:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "LGPS:AS01:1:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "LGPS:AS01:1:BMON") field(INPB, "LGPS:AS01:1:POLYCOEF") field(INPC, "LGPS:AS01:1:POLYCOEF.A") field(INPD, "LGPS:AS01:1:POLYCOEF.B") field(INPE, "LGPS:AS01:1:IMON MS") field(INPF, "LGPS:AS01: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:AS01:1:BDES CP record(ao, "LGPS:AS01: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:AS01:1:BDES.DRVH") field(OUT, "LGPS:AS01:1:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "LGPS:AS01:1:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "LGPS:AS01:1:POLYCOEF") field(INPC, "LGPS:AS01:1:POLYCOEF.A") field(INPD, "LGPS:AS01:1:POLYCOEF.B") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(MDEL, "-1") field(INPE, "LGPS:AS01:1:BDES.DRVH") field(INPF, "LGPS:AS01:1:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "LGPS:AS01:1:IDES") } record(sub, "LGPS:AS01:1:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "LGPS:AS01:1:POLYCOEF") field(INPC, "LGPS:AS01:1:POLYCOEF.A") field(INPD, "LGPS:AS01:1:POLYCOEF.B") field(INPE, "LGPS:AS01:1:BDES.DRVH") field(INPF, "LGPS:AS01:1:BDES.DRVL") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "LGPS:AS01:1:INOM") } record(sub, "LGPS:AS01:1:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "LGPS:AS01:1:BDES.VAL") field(INPB, "LGPS:AS01:1:BDES.DRVH") field(INPC, "LGPS:AS01:1:BDES.DRVL") field(INPD, "LGPS:AS01:1:BDELTAS.I") field(INPE, "LGPS:AS01:1:BDELTAS.J") field(INPG, "LGPS:AS01:1:STATE") field(INPH, "LGPS:AS01:1:HSTA") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "LGPS:AS01:1:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "LGPS:AS01:1:BDES.VAL") field(INPB, "LGPS:AS01:1:BDES.DRVH") field(INPC, "LGPS:AS01:1:BDES.DRVL") field(INPD, "LGPS:AS01:1:BDELTAS.K") field(INPE, "LGPS:AS01:1:BDELTAS.L") field(INPG, "LGPS:AS01:1:STATE") field(INPH, "LGPS:AS01:1:HSTA") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "LGPS:AS01:1:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "3") field(DOL1, "LGPS:AS01:1:BLIMITS") field(LNK1, "LGPS:AS01:1:BACTLIMITS.F PP") field(DOL2, "LGPS:AS01:1:BACTLIMITS.I") field(LNK2, "LGPS:AS01:1:BACT.HIGH") field(DOL3, "LGPS:AS01:1:BACTLIMITS.J") field(LNK3, "LGPS:AS01:1:BACT.LOW") field(DOL4, "LGPS:AS01:1:BACTLIMITS.K") field(LNK4, "LGPS:AS01:1:BACT.HIHI") field(DOL5, "LGPS:AS01:1:BACTLIMITS.L") field(LNK5, "LGPS:AS01:1:BACT.LOLO") field(DOL6, "LGPS:AS01:1:BLIMITS") field(LNK6, "LGPS:AS01:1:BMONLIMITS.F PP") field(DOL7, "LGPS:AS01:1:BMONLIMITS.I") field(LNK7, "LGPS:AS01:1:BMON.HIGH") field(DOL8, "LGPS:AS01:1:BMONLIMITS.J") field(LNK8, "LGPS:AS01:1:BMON.LOW") field(DOL9, "LGPS:AS01:1:BMONLIMITS.K") field(LNK9, "LGPS:AS01:1:BMON.HIHI") field(DOLA, "LGPS:AS01:1:BMONLIMITS.L") field(LNKA, "LGPS:AS01:1:BMON.LOLO") field(FLNK, "LGPS:AS01:1:ILIMITS") field(SCAN, "5 second") } record(ao, "LGPS:AS01: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:AS01: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:AS01:1:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "3") # Disable BACT limits field(DOL1, "1") field(LNK1, "LGPS:AS01:1:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "LGPS:AS01:1:BCTRL.VAL") field(LNK2, "LGPS:AS01:1:BDES PP") field(DOL3, "1") field(LNK3, "LGPS:AS01:1:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "LGPS:AS01:1:CHECKSTDZLOST.PROC PP") field(DOL5, "LGPS:AS01:1:BCTRL.VAL") field(LNK5, "LGPS:AS01:1:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "LGPS:AS01:1:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "LGPS:AS01:1:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "LGPS:AS01:1:POLYCOEF") field(INPC, "LGPS:AS01:1:POLYCOEF.A") field(INPD, "LGPS:AS01:1:POLYCOEF.B") field(INPE, "LGPS:AS01:1:BDES.DRVH") field(INPF, "LGPS:AS01: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:AS01:1:ISETPT") } record(ao, "LGPS:AS01: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:AS01:1:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "B044-ASTA-0109") } record(ai, "LGPS:AS01: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:AS01: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:AS01:1:BSTEP") } record(ao, "LGPS:AS01: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:AS01:1:BSTEP") } record(ao, "LGPS:AS01: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:AS01: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:AS01: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:AS01:1:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "LGPS:AS01:1:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "LGPS:AS01:1:POLYCOEF") field(INPC, "LGPS:AS01:1:POLYCOEF.A") field(INPD, "LGPS:AS01:1:POLYCOEF.B") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(MDEL, "-1") field(INPE, "LGPS:AS01:1:BCON.DRVH") field(INPF, "LGPS:AS01:1:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "LGPS:AS01: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:AS01:1:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "LGPS:AS01:1:BMAX") field(INPB, "LGPS:AS01:1:BMIN") field(INPC, "LGPS:AS01:1:BMIN.SEVR") field(INPD, "LGPS:AS01: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:AS01:1:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "LGPS:AS01:1:ONLINE CP") field(OUT, "LGPS:AS01:1:BCTRLDISABLEFOUT PP") } record(fanout, "LGPS:AS01:1:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "LGPS:AS01:1:BCTRLDISABLECALC") field(LNK1, "LGPS:AS01:1:BCTRLDISABLE") field(LNK2, "LGPS:AS01:1:BCTRLENABLE") } record(stringout, "LGPS:AS01:1:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "LGPS:AS01:1:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "LGPS:AS01:1:BCTRLDISV_UPDATE") } record(stringout, "LGPS:AS01:1:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "LGPS:AS01:1:BCTRL.ASG") field(VAL, "") field(FLNK, "LGPS:AS01:1:BCTRLDISV_UPDATE") } record(calcout, "LGPS:AS01:1:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "LGPS:AS01:1:ONLINE") field(OUT, "LGPS:AS01: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:AS01:1:BACT and MON\n are processed via links from \n LGPS:AS01:1:IACT (device raw value readback 1)\n and\n LGPS:AS01: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:AS01:1:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = LGPS:AS01: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:AS01:1:BDES\n is processed when set by CA users or \n LGPS:AS01: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:AS01: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:AS01: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:AS01: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:AS01:1:B*LIMITS and LGPS:AS01:1:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from LGPS:AS01: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:AS01: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:AS01: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:AS01: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:AS01:1:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "Volts") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "LGPS:AS01:1:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "LGPS:AS01: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:AS01: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:AS01: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:AS01: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:AS01: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:AS01:1:MPSLIMITS.E PP") } record(aSub, "LGPS:AS01: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:AS01:1:MPS.RVAL") field(INPB, "LGPS:AS01:1:BADIFF") field(INPC, "LGPS:AS01:1:BDELTAS.N") field(INPD, "LGPS:AS01:1:BACT") field(INPE, "LGPS:AS01:1:MPSBITMASK.RVAL") field(INPF, "LGPS:AS01:1:MPSBLLIM") field(INPG, "LGPS:AS01:1:MPSBMIN") field(INPH, "LGPS:AS01:1:MPSBMAX") field(INPI, "LGPS:AS01: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:AS01:1:INTOL.RVAL PP") field(OUTB, "LGPS:AS01:1:INTOL_BMIN.RVAL PP") field(OUTC, "LGPS:AS01:1:INTOL_BRANGE.RVAL PP") field(OUTD, "LGPS:AS01: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:AS01:1:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:AS01: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:AS01:1:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:AS01: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:AS01:1:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:AS01: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:AS01:1:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:AS01: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:AS01:1:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "LGPS:AS01:1:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "LGPS:AS01:1:CHCKBTOL") field(INPB, "LGPS:AS01:1:POLYCOEF.B") field(PREC, "9") } record(calc, "LGPS:AS01: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:AS01:1:CHCKBTOL") field(FLNK, "LGPS:AS01:1:CHCKITOL") } record(calc, "LGPS:AS01:1:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "LGPS:AS01:1:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "LGPS:AS01:1:BDES.HOPR") field(INPB, "LGPS:AS01:1:STABILITY") field(INPC, "LGPS:AS01:1:BDES.LOPR") } record(longout, "LGPS:AS01: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:AS01:1:CHCKBTOL") } record(calc, "LGPS:AS01:1:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "Volts") field(CALC, "ABS(A*B)") field(INPA, "LGPS:AS01:1:POLYCOEF.B") field(INPB, "LGPS:AS01:1:TRIMBTOL") field(PREC, "9") } record(ai, "LGPS:AS01: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:AS01: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:AS01:1:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "LGPS:AS01:1:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "LGPS:AS01:1:PAUGO") } record(fanout, "LGPS:AS01:1:PAUGO") { field(DESC, "PAU control") field(LNK1, "LGPS:AS01:1:PAUSTOP") field(LNK2, "LGPS:AS01: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:AS01:1:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "LGPS:AS01: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:AS01:1:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "LGPS:AS01: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:AS01:1:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "PS:AS01:1:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "LGPS:AS01: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:AS01:1:PSTYPE.RVAL") field(INPC, "LGPS:AS01:1:TURNEDOFF.RVAL") field(INPD, "LGPS:AS01:1:CONFIG.RVAL") field(INPE, "LGPS:AS01:1:PSCATEGORY.RVAL") field(INPF, "LGPS:AS01:1:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "LGPS:AS01:1:AUTOCTRL.RVAL") field(INPJ, "LGPS:AS01:1:OUTOFSERVICE.RVAL") field(INPL, "LGPS:AS01:1:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "LGPS:AS01:1:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "LGPS:AS01:1:PAU") field(INPP, "LGPS:AS01:1:CALBDISABLE.RVAL") field(INPQ, "LGPS:AS01:1:PTRBDISABLE.RVAL") field(INPR, "LGPS:AS01:1:TRIMDISABLE.RVAL") field(INPS, "LGPS:AS01:1:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "LGPS:AS01:1:FBCK") field(INPU, "LGPS:AS01:1:TRIMTYPE.RVAL") field(INPV, "LGPS:AS01:1:STDZDIRECT.RVAL") field(INPW, "LGPS:AS01:1:DEGAUSENABLE.RVAL") field(FLNK, "LGPS:AS01:1:HSTA") } record(longin, "LGPS:AS01:1:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "LGPS:AS01:1:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "LGPS:AS01: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:AS01: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:AS01: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:AS01: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:AS01: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:AS01: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:AS01:1:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses LGPS:AS01:1:FBCK. # This PV should be replaced by LGPS:AS01: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:AS01: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:AS01: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:AS01: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:AS01:1:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"LGPS:AS01:1:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "LGPS:AS01:1:OUTOFSERVICE NPP NMS") field(OUT, "LGPS:AS01:1:ONLINE PP") } record(bo, "LGPS:AS01:1:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "LGPS:AS01: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:AS01: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:AS01: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:AS01: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:AS01: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:AS01: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:AS01: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:AS01: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:AS01: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:AS01: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:AS01: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:AS01:1:TRIMTYPE") } record(stringout, "LGPS:AS01:1:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "LGPS:AS01:1:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "LGPS:AS01:1:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "LGPS:AS01:1:STATE.RVAL") field(INPB, "LGPS:AS01:1:INTLKSUMY.RVAL") field(OUT, "LGPS:AS01:1:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "LGPS:AS01: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:AS01:1:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "LGPS:AS01:1:STATE.RVAL") field(INPB, "LGPS:AS01:1:INTLKSUMY.RVAL") field(OUT, "LGPS:AS01:1:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "LGPS:AS01:1:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "LGPS:AS01:1:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "LGPS:AS01: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:AS01: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:AS01: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:AS01: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:AS01: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:AS01:1:TURNEDOFF",3140,1907,0,1,"LGPS:AS01:1:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "LGPS:AS01:1:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "LGPS:AS01:1:BACT.STAT") field(INPB, "LGPS:AS01:1:BDES.STAT") field(INPC, "LGPS:AS01:1:IRIPL.STAT") field(INPD, "PS:AS01:1:ISETPT.STAT") field(INPE, "PS:AS01: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:AS01:1:BACT.SEVR") field(INPH, "LGPS:AS01:1:BDES.SEVR") field(INPI, "LGPS:AS01:1:IRIPL.SEVR") field(INPJ, "PS:AS01:1:ISETPT.SEVR") field(INPK, "PS:AS01: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:AS01:1:STATE.RVAL") field(INPN, "LGPS:AS01:1:STDZOK") field(INPO, "LGPS:AS01:1:CALBOK") field(INPP, "LGPS:AS01:1:OUTOFSERVICE.RVAL") field(INPQ, "LGPS:AS01:1:CONFIG.RVAL") field(INPR, "LGPS:AS01:1:HSTA") field(INPS, "LGPS:AS01:1:CTRL.RVAL") field(INPT, "LGPS:AS01:1:DEGAUSOK") field(INPV, "LGPS:AS01: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:AS01:1:STAT") } record(longout, "LGPS:AS01:1:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "LGPS:AS01:1:STATCTRLSUB") field(DOL, "LGPS:AS01:1:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "LGPS:AS01:1:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "LGPS:AS01:1:STAT") field(INPB, "LGPS:AS01:1:HSTA") field(INPD, "LGPS:AS01:1:ONOFFCTRL.RVAL") field(FLNK, "LGPS:AS01:1:STATMSG") } record(mbbo, "LGPS:AS01: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:AS01:1:UNAVAILGO") field(DOL, "LGPS:AS01:1:STATCTRLSUB.W") } record(seq, "LGPS:AS01:1:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "LGPS:AS01:1:STATSUB.U") field(LNK1, "LGPS:AS01:1:UNAVAIL PP") } record(stringout, "LGPS:AS01:1:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"LGPS:AS01:1:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - LGPS:AS01:1:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - LGPS:AS01: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:AS01:1STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - LGPS:AS01:1:STATUS\nC - LGPS:AS01:1:ON\nD - LGPS:AS01:1:STDZOK\nE - LGPS:AS01:1:CALBOK\nF - LGPS:AS01:1:BACTDRIFT (future)\nG -\nH- LGPS:AS01:1:DACSTATUS\nI -LGPS:AS01:1:ADCSTATUS\nJ - LGPS:AS01:1:BACTSTATUS\nK - LGPS:AS01:1:BDESSTATUS\nL - LGPS:AS01:1:RIPLSTATUS\n\nOutput:\nP - LGPS:AS01: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:AS01: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:AS01: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:AS01: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:AS01: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:AS01:1:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "LGPS:AS01:1:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "LGPS:AS01:1:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "LGPS:AS01:1:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "LGPS:AS01:1:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "LGPS:AS01:1:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "LGPS:AS01: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:AS01:1:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "LGPS:AS01:1:TRIMTYPE.RVAL") field(INPB, "LGPS:AS01:1:CONFIG.RVAL") field(OUT, "LGPS:AS01:1:TRIMMAXNUM PP") } record(longout, "LGPS:AS01: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:AS01: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:AS01:1:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "LGPS:AS01: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:AS01: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:AS01: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:AS01: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:AS01: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:AS01: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:AS01:1:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "LGPS:AS01: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:AS01: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:AS01:1:IMOVE") field(INPB, "LGPS:AS01:1:IACT") field(INPC, "LGPS:AS01:1:IRAMPRATE") field(INPD, "1.0") field(INPE, "LGPS:AS01:1:TRIMDLYPCT") field(INPF, "LGPS:AS01:1:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "LGPS:AS01:1:RAMPTIME_LEFT PP") } record(longout, "LGPS:AS01:1:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "LGPS:AS01:1:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "LGPS:AS01:1:RAMPDONE_CALC") } record(calc, "LGPS:AS01:1:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "LGPS:AS01:1:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "LGPS:AS01:1:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "LGPS:AS01: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:AS01:1:RAMPTIME_LEFT") field(OUT, "LGPS:AS01:1:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "LGPS:AS01:1:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "LGPS:AS01:1:RAMPTIME_LEFT NMS") field(OUT, "LGPS:AS01:1:RAMPDONE PP") } record(bo, "LGPS:AS01:1:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "LGPS:AS01:1:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "LGPS:AS01: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:AS01: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:AS01: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:AS01:1:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "Volts") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "LGPS:AS01:1:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "LGPS:AS01: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:AS01: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:AS01: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:AS01: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:AS01: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:AS01:1:MPSLIMITS.E PP") } record(aSub, "LGPS:AS01: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:AS01:1:MPS.RVAL") field(INPB, "LGPS:AS01:1:BADIFF") field(INPC, "LGPS:AS01:1:BDELTAS.N") field(INPD, "LGPS:AS01:1:BACT") field(INPE, "LGPS:AS01:1:MPSBITMASK.RVAL") field(INPF, "LGPS:AS01:1:MPSBLLIM") field(INPG, "LGPS:AS01:1:MPSBMIN") field(INPH, "LGPS:AS01:1:MPSBMAX") field(INPI, "LGPS:AS01: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:AS01:1:INTOL.RVAL PP") field(OUTB, "LGPS:AS01:1:INTOL_BMIN.RVAL PP") field(OUTC, "LGPS:AS01:1:INTOL_BRANGE.RVAL PP") field(OUTD, "LGPS:AS01: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:AS01:1:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:AS01: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:AS01:1:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:AS01: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:AS01:1:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:AS01: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:AS01:1:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:AS01: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:AS01:1:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "LGPS:AS01:1:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "LGPS:AS01:1:CHCKBTOL") field(INPB, "LGPS:AS01:1:POLYCOEF.B") field(PREC, "9") } record(calc, "LGPS:AS01: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:AS01:1:CHCKBTOL") field(FLNK, "LGPS:AS01:1:CHCKITOL") } record(calc, "LGPS:AS01:1:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "LGPS:AS01:1:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "LGPS:AS01:1:BDES.HOPR") field(INPB, "LGPS:AS01:1:STABILITY") field(INPC, "LGPS:AS01:1:BDES.LOPR") } record(longout, "LGPS:AS01: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:AS01:1:CHCKBTOL") } record(calc, "LGPS:AS01:1:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "Volts") field(CALC, "ABS(A*B)") field(INPA, "LGPS:AS01:1:POLYCOEF.B") field(INPB, "LGPS:AS01:1:TRIMBTOL") field(PREC, "9") } record(ai, "LGPS:AS01: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:AS01: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:AS01: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:AS01:1:PSTYPE.RVAL") field(INPC, "LGPS:AS01:1:TURNEDOFF.RVAL") field(INPD, "LGPS:AS01:1:CONFIG.RVAL") field(INPE, "LGPS:AS01:1:PSCATEGORY.RVAL") field(INPF, "LGPS:AS01:1:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "LGPS:AS01:1:AUTOCTRL.RVAL") field(INPJ, "LGPS:AS01:1:OUTOFSERVICE.RVAL") field(INPL, "LGPS:AS01:1:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "LGPS:AS01:1:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "LGPS:AS01:1:PAU") field(INPP, "LGPS:AS01:1:CALBDISABLE.RVAL") field(INPQ, "LGPS:AS01:1:PTRBDISABLE.RVAL") field(INPR, "LGPS:AS01:1:TRIMDISABLE.RVAL") field(INPS, "LGPS:AS01:1:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "LGPS:AS01:1:FBCK") field(INPU, "LGPS:AS01:1:TRIMTYPE.RVAL") field(INPV, "LGPS:AS01:1:STDZDIRECT.RVAL") field(INPW, "LGPS:AS01:1:DEGAUSENABLE.RVAL") field(FLNK, "LGPS:AS01:1:HSTA") } record(longin, "LGPS:AS01:1:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "LGPS:AS01:1:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "LGPS:AS01: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:AS01: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:AS01: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:AS01: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:AS01: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:AS01: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:AS01:1:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses LGPS:AS01:1:FBCK. # This PV should be replaced by LGPS:AS01: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:AS01: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:AS01: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:AS01: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:AS01:1:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"LGPS:AS01:1:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "LGPS:AS01:1:OUTOFSERVICE NPP NMS") field(OUT, "LGPS:AS01:1:ONLINE PP") } record(bo, "LGPS:AS01:1:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "PS:AS01:1:CommLink PP") } record(bo, "LGPS:AS01: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:AS01: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:AS01: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:AS01: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:AS01: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:AS01: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:AS01: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:AS01: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:AS01: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:AS01: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:AS01: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:AS01:1:TRIMTYPE") } record(stringout, "LGPS:AS01:1:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "LGPS:AS01:1:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "LGPS:AS01:1:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "LGPS:AS01:1:STATE.RVAL") field(INPB, "LGPS:AS01:1:INTLKSUMY.RVAL") field(OUT, "LGPS:AS01:1:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "LGPS:AS01: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:AS01:1:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "LGPS:AS01:1:STATE.RVAL") field(INPB, "LGPS:AS01:1:INTLKSUMY.RVAL") field(OUT, "LGPS:AS01:1:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "LGPS:AS01:1:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "LGPS:AS01:1:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "LGPS:AS01: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:AS01: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:AS01: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:AS01: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:AS01: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:AS01:1:TURNEDOFF",3140,1907,0,1,"LGPS:AS01:1:TURNEDOFF") #! 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, "SOLN:AS01:111:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "000000") } record(stringout, "SOLN:AS01:111:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "SOLN:AS01:111:POLYCOEF") { field(DESC, "SOLN:AS01:111 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "0") field(B, "5.6104e-2") field(C, "0") field(D, "0") field(E, "0") field(F, "0") field(G, "0") field(H, "0") field(I, "0") field(J, "0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "SOLN:AS01:111:POLYCOEFNUM") } record(longin, "SOLN:AS01:111:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "SOLN:AS01:111:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "SOLN:AS01:111:COEF2IVB") } record(sub, "SOLN:AS01:111:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "SOLN:AS01:111:POLYCOEF") field(INPB, "SOLN:AS01:111:IVB") # Need to process IVB so that UDF=0 field(FLNK, "SOLN:AS01:111: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, "SOLN:AS01:111: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:AS01:121:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "000000") } record(stringout, "QUAD:AS01:121:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "QUAD:AS01:121:POLYCOEF") { field(DESC, "QUAD:AS01:121 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "0") field(B, "7.690e-1") field(C, "0") field(D, "0") field(E, "0") field(F, "0") field(G, "0") field(H, "0") field(I, "0") field(J, "0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "QUAD:AS01:121:POLYCOEFNUM") } record(longin, "QUAD:AS01:121:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "QUAD:AS01:121:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "QUAD:AS01:121:COEF2IVB") } record(sub, "QUAD:AS01:121:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "QUAD:AS01:121:POLYCOEF") field(INPB, "QUAD:AS01:121:IVB") # Need to process IVB so that UDF=0 field(FLNK, "QUAD:AS01:121: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:AS01:121: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, "XCOR:AS01:121:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "000000") } record(stringout, "XCOR:AS01:121:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "XCOR:AS01:121:POLYCOEF") { field(DESC, "XCOR:AS01:121 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "-0.323846e-5") field(B, "769.231e-5") field(C, "0") field(D, "0") field(E, "0") field(F, "0") field(G, "0") field(H, "0") field(I, "0") field(J, "0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "XCOR:AS01:121:POLYCOEFNUM") } record(longin, "XCOR:AS01:121:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "XCOR:AS01:121:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "XCOR:AS01:121:COEF2IVB") } record(sub, "XCOR:AS01:121:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "XCOR:AS01:121:POLYCOEF") field(INPB, "XCOR:AS01:121:IVB") # Need to process IVB so that UDF=0 field(FLNK, "XCOR:AS01:121: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, "XCOR:AS01:121: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, "YCOR:AS01:122:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "000000") } record(stringout, "YCOR:AS01:122:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "YCOR:AS01:122:POLYCOEF") { field(DESC, "YCOR:AS01:122 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "-0.309e-5") field(B, "751.88e-5") field(C, "0") field(D, "0") field(E, "0") field(F, "0") field(G, "0") field(H, "0") field(I, "0") field(J, "0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "YCOR:AS01:122:POLYCOEFNUM") } record(longin, "YCOR:AS01:122:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "YCOR:AS01:122:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "YCOR:AS01:122:COEF2IVB") } record(sub, "YCOR:AS01:122:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "YCOR:AS01:122:POLYCOEF") field(INPB, "YCOR:AS01:122:IVB") # Need to process IVB so that UDF=0 field(FLNK, "YCOR:AS01:122: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, "YCOR:AS01:122: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:AS01:122:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "000000") } record(stringout, "QUAD:AS01:122:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "QUAD:AS01:122:POLYCOEF") { field(DESC, "QUAD:AS01:122 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "0") field(B, "7.301e-1") field(C, "0") field(D, "0") field(E, "0") field(F, "0") field(G, "0") field(H, "0") field(I, "0") field(J, "0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "QUAD:AS01:122:POLYCOEFNUM") } record(longin, "QUAD:AS01:122:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "QUAD:AS01:122:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "QUAD:AS01:122:COEF2IVB") } record(sub, "QUAD:AS01:122:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "QUAD:AS01:122:POLYCOEF") field(INPB, "QUAD:AS01:122:IVB") # Need to process IVB so that UDF=0 field(FLNK, "QUAD:AS01:122: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:AS01:122: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, "XCOR:AS01:221:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "000000") } record(stringout, "XCOR:AS01:221:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "XCOR:AS01:221:POLYCOEF") { field(DESC, "XCOR:AS01:221 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "0") field(B, "5574.1e-5") field(C, "0") field(D, "0") field(E, "0") field(F, "0") field(G, "0") field(H, "0") field(I, "0") field(J, "0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "XCOR:AS01:221:POLYCOEFNUM") } record(longin, "XCOR:AS01:221:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "XCOR:AS01:221:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "XCOR:AS01:221:COEF2IVB") } record(sub, "XCOR:AS01:221:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "XCOR:AS01:221:POLYCOEF") field(INPB, "XCOR:AS01:221:IVB") # Need to process IVB so that UDF=0 field(FLNK, "XCOR:AS01:221: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, "XCOR:AS01:221: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, "YCOR:AS01:222:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "000000") } record(stringout, "YCOR:AS01:222:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "YCOR:AS01:222:POLYCOEF") { field(DESC, "YCOR:AS01:222 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "0") field(B, "5131.5e-5") field(C, "0") field(D, "0") field(E, "0") field(F, "0") field(G, "0") field(H, "0") field(I, "0") field(J, "0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "YCOR:AS01:222:POLYCOEFNUM") } record(longin, "YCOR:AS01:222:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "YCOR:AS01:222:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "YCOR:AS01:222:COEF2IVB") } record(sub, "YCOR:AS01:222:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "YCOR:AS01:222:POLYCOEF") field(INPB, "YCOR:AS01:222:IVB") # Need to process IVB so that UDF=0 field(FLNK, "YCOR:AS01:222: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, "YCOR:AS01:222: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, "XCOR:AS01:321:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "000000") } record(stringout, "XCOR:AS01:321:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "XCOR:AS01:321:POLYCOEF") { field(DESC, "XCOR:AS01:321 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "0") field(B, "5574.1e-5") field(C, "0") field(D, "0") field(E, "0") field(F, "0") field(G, "0") field(H, "0") field(I, "0") field(J, "0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "XCOR:AS01:321:POLYCOEFNUM") } record(longin, "XCOR:AS01:321:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "XCOR:AS01:321:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "XCOR:AS01:321:COEF2IVB") } record(sub, "XCOR:AS01:321:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "XCOR:AS01:321:POLYCOEF") field(INPB, "XCOR:AS01:321:IVB") # Need to process IVB so that UDF=0 field(FLNK, "XCOR:AS01:321: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, "XCOR:AS01:321: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, "YCOR:AS01:322:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "000000") } record(stringout, "YCOR:AS01:322:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "YCOR:AS01:322:POLYCOEF") { field(DESC, "YCOR:AS01:322 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "0") field(B, "5131.5e-5") field(C, "0") field(D, "0") field(E, "0") field(F, "0") field(G, "0") field(H, "0") field(I, "0") field(J, "0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "YCOR:AS01:322:POLYCOEFNUM") } record(longin, "YCOR:AS01:322:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "YCOR:AS01:322:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "YCOR:AS01:322:COEF2IVB") } record(sub, "YCOR:AS01:322:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "YCOR:AS01:322:POLYCOEF") field(INPB, "YCOR:AS01:322:IVB") # Need to process IVB so that UDF=0 field(FLNK, "YCOR:AS01:322: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, "YCOR:AS01:322: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, "XCOR:AS01:341:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "000000") } record(stringout, "XCOR:AS01:341:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "XCOR:AS01:341:POLYCOEF") { field(DESC, "XCOR:AS01:341 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "0") field(B, "4900.0e-5") field(C, "0") field(D, "0") field(E, "0") field(F, "0") field(G, "0") field(H, "0") field(I, "0") field(J, "0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "XCOR:AS01:341:POLYCOEFNUM") } record(longin, "XCOR:AS01:341:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "XCOR:AS01:341:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "XCOR:AS01:341:COEF2IVB") } record(sub, "XCOR:AS01:341:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "XCOR:AS01:341:POLYCOEF") field(INPB, "XCOR:AS01:341:IVB") # Need to process IVB so that UDF=0 field(FLNK, "XCOR:AS01:341: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, "XCOR:AS01:341: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, "YCOR:AS01:342:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "000000") } record(stringout, "YCOR:AS01:342:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "YCOR:AS01:342:POLYCOEF") { field(DESC, "YCOR:AS01:342 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "0") field(B, "4900.0e-5") field(C, "0") field(D, "0") field(E, "0") field(F, "0") field(G, "0") field(H, "0") field(I, "0") field(J, "0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "YCOR:AS01:342:POLYCOEFNUM") } record(longin, "YCOR:AS01:342:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "YCOR:AS01:342:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "YCOR:AS01:342:COEF2IVB") } record(sub, "YCOR:AS01:342:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "YCOR:AS01:342:POLYCOEF") field(INPB, "YCOR:AS01:342:IVB") # Need to process IVB so that UDF=0 field(FLNK, "YCOR:AS01:342: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, "YCOR:AS01:342: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:AS01:931:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "000000") } record(stringout, "BEND:AS01:931:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "BEND:AS01:931:POLYCOEF") { field(DESC, "BEND:AS01:931 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "0") field(B, "1.0") field(C, "0") field(D, "0") field(E, "0") field(F, "0") field(G, "0") field(H, "0") field(I, "0") field(J, "0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "BEND:AS01:931:POLYCOEFNUM") } record(longin, "BEND:AS01:931:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "BEND:AS01:931:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "BEND:AS01:931:COEF2IVB") } record(sub, "BEND:AS01:931:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "BEND:AS01:931:POLYCOEF") field(INPB, "BEND:AS01:931:IVB") # Need to process IVB so that UDF=0 field(FLNK, "BEND:AS01:931: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:AS01:931: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:AS01:1:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "000000") } record(stringout, "LGPS:AS01:1:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "LGPS:AS01:1:POLYCOEF") { field(DESC, "LGPS:AS01: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") field(J, "0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "LGPS:AS01:1:POLYCOEFNUM") } record(longin, "LGPS:AS01:1:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "LGPS:AS01:1:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "LGPS:AS01:1:COEF2IVB") } record(sub, "LGPS:AS01:1:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "LGPS:AS01:1:POLYCOEF") field(INPB, "LGPS:AS01:1:IVB") # Need to process IVB so that UDF=0 field(FLNK, "LGPS:AS01: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:AS01: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/mgnt.dbd") #! DBDEND record(ai, "MCOR:AS01:101:VACT") { field(DESC, "ADC Chan 0") field(SCAN, ".5 second") field(DTYP, "Hytec IP-ADC-8413") field(INP, "@ai0:0:DATA") field(PREC, "9") field(LINR, "LINEAR") field(EGUF, "10.0") field(EGUL, "-10.0") field(EGU, "V") field(HOPR, "10.0") field(LOPR, "-10.0") field(FLNK, "MCOR:AS01:101:IACT") } record(bo,"MCOR:AS01:101:CALBSETPT") { field(DESC, "Use ADC Calbration ") field(DTYP, "Hytec IP-ADC-8413") field(OUT, "@ai0:0:CAL") field(ZNAM, "Not-In-Use") field(ONAM, "In-Use") field(DOL, "1") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK,"MCOR:AS01:101:CALBSTATE") } record(bi, "MCOR:AS01:101:CALBSTATE") { field(DESC, "ADC Calibration Status") field(DTYP, "Hytec IP-ADC-8413") field(INP, "@ai0:0:CAL") field(ZNAM, "Not-In-Use") field(ONAM, "In-Use") } record(ao, "MCOR:AS01:101:ADCCHAN") { field(DESC, "ADC Chan") field(PINI, "YES") field(HOPR, "15") field(LOPR, "0") field(VAL, "0") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgnt.dbd") #! DBDEND record(ao, "MCOR:AS01:101:VSETPT") { field(DESC, "DAC ao0 Ch 0 Setpoint") field(DTYP, "ACROMAG-IP231") field(OUT, "@ao0:0:DATA") field(PREC, "9") field(EGUF, "10.0") field(EGUL, "-10.0") field(HOPR, "10.0") field(LOPR, "-10.0") field(EGU, "V") field(LINR, "LINEAR") field(DRVH, "10.0") field(DRVL, "-10.0") field(DOL, "MCOR:AS01:101:VSETPTCALC") field(OMSL, "closed_loop") } record(ai, "MCOR:AS01:101:DACCHAN") { field(DESC, "ADC ao0 Ch 0") field(PINI, "YES") field(HOPR, "15") field(LOPR, "0") field(VAL, "0") } record(stringout, "MCOR:AS01:101:DACCARDNAME") { field(DESC, "DAC ao0 Name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "ao0") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgnt.dbd") #! DBDEND record(ao, "MCOR:AS01:101:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(EGU, "A") field(PREC, "9") field(HOPR, "30") field(LOPR, "30") field(FLNK, "MCOR:AS01:101:VSETPTCALC") info(autosaveFields,"VAL") } record(calc, "MCOR:AS01:101:VSETPTCALC") { field(DESC, "Calc Voltage Setpoint") field(CALC, "(C*A)+B") field(INPA, "MCOR:AS01:101:I2VSLOPE") field(INPB, "0.0") field(INPC, "MCOR:AS01:101:ISETPT") field(EGU, "V") field(PREC, "9") field(FLNK, "MCOR:AS01:101:VSETPT") info(autosaveFields,"VAL") } record(calc, "MCOR:AS01:101:IACT") { field(DESC, "Calculate Actual Current") field(CALC, "(C*A)+B") field(INPA, "MCOR:AS01:101:V2ISLOPE") field(INPB, "0.0") field(INPC, "MCOR:AS01:101:VACT") field(EGU, "A") field(PREC, "9") # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # field(FLNK, "SOLN:AS01:111:IACT") } # Used for stepping DAC record(longout, "MCOR:AS01:101:DACSTEP") { field(DESC, "DAC steps") field(EGU, "DAC Counts") field(DRVH, "100") field(HOPR, "100") field(VAL, "3") field(FLNK, "MCOR:AS01:101:VSTEP") } record(calc, "MCOR:AS01:101:VSTEP") { field(DESC, "Step in volts") field(CALC, "B?((C-D)/B)*A:0") field(INPA, "MCOR:AS01:101:DACSTEP") field(INPB, "65535") field(INPC, "MCOR:AS01:101:VSETPT.HOPR") field(INPD, "MCOR:AS01:101:VSETPT.LOPR") field(EGU, "V") field(PREC, "9") field(FLNK, "MCOR:AS01:101:ISTEP") } record(calc, "MCOR:AS01:101:ISTEP") { field(DESC, "Step in I") field(CALC, "(C-D)==0?0:A*(B/(C-D))") field(INPA, "MCOR:AS01:101:VSTEP") field(INPB, "MCOR:AS01:101:VSTEP.C") field(INPC, "MCOR:AS01:101:IMAX_DAC") field(INPD, "MCOR:AS01:101:IMIN_DAC") field(EGU, "A") field(PREC, "9") # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # field(FLNK, "SOLN:AS01:111:TRIMSTEPMIN") } record(calc, "MCOR:AS01:101:V2ISLOPE") { field(DESC, "Slope for V to I conversion") field(CALC, "(C-D)==0?0:(A-B)/(C-D)") field(INPA, "MCOR:AS01:101:IMAX_ADC") field(INPB, "MCOR:AS01:101:IMIN_ADC") field(INPC, "MCOR:AS01:101:VSETPT.HOPR") field(INPD, "MCOR:AS01:101:VSETPT.LOPR") field(PREC, "9") } record(calcout, "MCOR:AS01:101:I2VSLOPE") { field(DESC, "Slope for I to V conversion") field(CALC, "(A-B)==0?0: (C-D)/(A-B)") field(INPA, "MCOR:AS01:101:IMAX_DAC") field(INPB, "MCOR:AS01:101:IMIN_DAC") field(INPC, "MCOR:AS01:101:VSETPT.HOPR") field(INPD, "MCOR:AS01:101:VSETPT.LOPR") field(PREC, "9") } # MCOR Power Module Type record(mbbo, "MCOR:AS01:101:TYPE") { field(DESC, "Chnl 0 Full Scale Output") field(DTYP, "Raw Soft Channel") field(NOBT, "3") field(ZRST, "Spare") field(ONST, "MCOR1") field(TWST, "MCOR2") field(THST, "MCOR6") field(FRST, "MCOR12") field(FVST, "MCOR30") field(ZRVL, "12") field(ONVL, "1") field(TWVL, "2") field(THVL, "6") field(FRVL, "12") field(FVVL, "30") field(PINI, "YES") field(VAL, "3") field(FLNK, "MCOR:AS01:101:IMAX_ADC") } record(calc, "MCOR:AS01:101:IMAX_ADC") { field(DESC, "Chnl 0 Full Scale Input") field(CALC, "(A=1)||(A=6)?A*2:A") field(INPA, "MCOR:AS01:101:TYPE.RVAL") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:101:IMIN_ADC") } record(calc, "MCOR:AS01:101:IMIN_ADC") { field(DESC, "Chnl 0 Min Curr Input") field(CALC, "-A") field(INPA, "MCOR:AS01:101:IMAX_ADC") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:101:IMIN_DAC") } record(calc, "MCOR:AS01:101:IMIN_DAC") { field(DESC, "Chnl 0 Min Curr Output") field(CALC, "-A") field(INPA, "MCOR:AS01:101:TYPE.RVAL") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:101:IMAX_DAC") } record(calc, "MCOR:AS01:101:IMAX_DAC") { field(DESC, "Chnl 0 Min Curr Output") field(CALC, "A") field(INPA, "MCOR:AS01:101:TYPE.RVAL") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:101:ILIMITS_DAC") } record(seq, "MCOR:AS01:101:ILIMITS_DAC") { field(DESC, "Set full scale range") field(ASG, "Internal") field(DOL1, "0") field(DOL2, "MCOR:AS01:101:IMAX_DAC") field(DOL3, "MCOR:AS01:101:IMIN_DAC") field(DOL4, "MCOR:AS01:101:IMAX_DAC") field(DOL5, "MCOR:AS01:101:IMIN_DAC") field(LNK1, "MCOR:AS01:101:I2VSLOPE.PROC") field(LNK2, "MCOR:AS01:101:ISETPT.DRVH") field(LNK3, "MCOR:AS01:101:ISETPT.DRVL") field(LNK4, "MCOR:AS01:101:ISETPT.HOPR") field(LNK5, "MCOR:AS01:101:ISETPT.LOPR PP" ) field(FLNK, "MCOR:AS01:101:ILIMITS_ADC") } record(seq, "MCOR:AS01:101:ILIMITS_ADC") { field(DESC, "Set full scale range") field(ASG, "Internal") field(DOL1, "0") field(DOL2, "MCOR:AS01:101:IMAX_ADC") field(DOL3, "MCOR:AS01:101:IMIN_ADC") field(DOL4, "0") field(LNK1, "MCOR:AS01:101:V2ISLOPE.PROC") field(LNK2, "MCOR:AS01:101:IACT.HOPR") field(LNK3, "MCOR:AS01:101:IACT.LOPR PP") field(LNK4, "MCOR:AS01:101:DACSTEP.PROC") } # Bulk Power Supply On/Off Status # BiRa MCOR controller does have capabiilty # to read the Bulk ps on/off control and status where as # the EMCOR Controller firmware does provided on/off bulok ps control # via backplane, and the EMCOR EPICS driver provides support. However, # this bulk on/off capabilty requires a hardware interface chassis between # the bulk and the MCOR crate, which has not been designed. Therefore # a soft pvs have been provided, which gets its data from another # pv that reads the bulk on/off status from the power supply (genesys) # directly or from a plc, which is connected to the power supply # on/off signal. The on/off status of each MCOR channel is generated from # this MCOR Bulk on/off status in combination with the MCOR Fault status # for this channel. The MCOR fault status is included because an MCOR # channel can be faulted while the bulk supply is on. # # SPECIAL CASE: # There are three (3) special cases of hardware configuration including # the hard and soft x-ray chicanes in the undulator and the xleap chicane # in the ltu. For these three (2) installations circuitry has been added # to provide a separate on/off control of individual mcor channels, which # is used by the chicane string main. This hardware includes a contactor # to provide the on/off control. The contactor which is controlled and # monitored by beckhoff digial i/o modules, to open/close the contactor # and to read the state of the contactor. For these three chicanes the # main mcor channel ps has an on/off control and status, separate from # the MCOR bulk status. If a contactor exists the PV for the on/off # is defined in the field INPE. Otherwise, this field is set to the # default(1), as shown below: # # INPE=1 - The default for all but ltu and und chicanes w/contactor # INPE=CONTACTOR_STATE CP # # The STATE_CALC pv is overloaded in mgntApp/Db/und/mgnt_und1_bkhf.substitutions # for the chicanes, which only instantiates the INPE field. # # VAL: (output value) # 0 - do nothing, unknown state # 1 - ps state off # 2 - ps state on # record(calcout, "MCOR:AS01:101:STATE_CALC") { field(DESC, "PS Status") # # If the bulk ps state is invalid, do nothing. If an the fault pv is invalid # output then set mcor chan state to the bulk state. If the bulk ps is on, the # mcor chan state is on, and the mcor chan is not faulted, then output set # mcor chan state to on (1). Otherwise, set the mcor chan state to off (0). # field(CALC, "A=3?0:D=3?3:A&&E&&(B=0)?2:1") field(OUT, "MCOR:AS01:101:STATE_SEQ.SELN PP") field(INPA, "MCOR:AS01:100:PS_STATE") field(INPB, "MCOR:AS01:101:INTLKSUMY CP") field(INPC, "MCOR:AS01:100:PS_STATE.SEVR") field(INPD, "MCOR:AS01:101:INTLKSUMY.SEVR") field(INPE, "1") } record(seq, "MCOR:AS01:101:STATE_SEQ") { field(DESC, "PS State Sequence") field(SELM, "Specified") field(DOL2, "1") field(DOL3, "MCOR:AS01:100:PS_STATE") field(LNK1, "MCOR:AS01:101:STATE PP") field(LNK2, "MCOR:AS01:101:STATE PP") field(LNK3, "MCOR:AS01:101:STATE PP") } record(bo, "MCOR:AS01:101:STATE") { field(DESC, "Bulk PS Status") field(ZNAM, "OFF") field(ONAM, "ON") # # If this is a spare mcor channel, instanciate the LNK macro with a "#" field(OUT, "SOLN:AS01:111:STATE PP MSS") } record(bo, "MCOR:AS01:101:TURNEDOFF") { field(DESC, "Bulk PS Turned Off by User") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "MCOR:AS01:100:PS_TURNEDOFF NPP MS") field(OMSL, "closed_loop") # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # field(OUT, "SOLN:AS01:111:TURNEDOFF PP MS") } # Bulk Power Supply On/Off Control # SLAC EMCOR controller does not have capabiilty # to control Bulk ps on/off. # Currently, this pv is just a place holder. record(bo, "MCOR:AS01:101:STATESETPT") { field(DESC, "PS On/Off Ctrl") field(DTYP, "Raw Soft Channel") field(ZNAM, "ON") field(ONAM, "OFF") field(OUT, "") } # MCOR fault status # Since the standard BiRa controller does not have a fault status # can only be read directly off of the backplane # that can be read from VME, the occurs if there is a power dip but the bulk has not tripped of. record(calcout, "MCOR:AS01:101:FAULTSTATE_CALC") { field(DESC, "MCOR Channel Fault Status") field(PINI, "YES") field(CALC, "A") field(OUT, "MCOR:AS01:101:FAULTSTATE PP") } record(bi, "MCOR:AS01:101:FAULTSTATE") { field(DESC, "Fault Status") field(DTYP, "Soft Channel") field(ZNAM, "OK") field(ONAM, "FAULTED") field(OSV, "MAJOR") field(FLNK, "MCOR:AS01:101:INTLKSUMY_CALC") } # If severity is invaild then output a zero (0) value record(calcout, "MCOR:AS01:101:INTLKSUMY_CALC") { field(DESC, "Interlock Summary Calculation") field(CALC, "A||B?1:0") field(INPA, "MCOR:AS01:101:FAULTSTATE NPP MSS") field(INPB, "MCOR:AS01:100:PS_LATCHED_FAULTSTATE NPP NMS") field(INPC, "MCOR:AS01:101:FAULTSTATE.SEVR CPP") field(IVOA, "Set output to IVOV") field(IVOV, "0") field(OUT, "MCOR:AS01:101:INTLKSUMY PP MSS") } record(bo, "MCOR:AS01:101:INTLKSUMY") { field(DESC, "Interlock Summary") field(DTYP, "Soft Channel") field(ZNAM, "OK") field(ONAM, "FAULTED") field(DOL, "MCOR:AS01:101:INTLKSUMY_CALC NPP MSS") field(OMSL, "closed_loop") # If this is a spare mcor channel, instanciate the LNK macro with a "#" field(OUT, "SOLN:AS01:111:INTLKSUMY PP MSS") } record(bo, "MCOR:AS01:101:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "NORESET") field(ONAM, "RESET") field(OUT, "MCOR:AS01:100:RESET PP") } # MCOR Crate Information # Note: this pv is use by the pau driver # for fast feedback. record(stringout, "MCOR:AS01:101:NAME") { field(DESC, "SOLN:AS01:111:") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, "SOL1BKS") } record(longout, "MCOR:AS01:101:CRATE") { field(DESC, "Crate 1") field(DTYP, "Soft Channel") field(HOPR, "4") field(LOPR, "1") field(PINI, "YES") field(VAL, "1") } record(longout, "MCOR:AS01:101:CHAN") { field(DESC, "Channel 0") field(DTYP, "Soft Channel") field(HOPR, "15") field(PINI, "YES") field(VAL, "0") } record(mbbo, "MCOR:AS01:101: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, "0") # # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # field(OUT, "SOLN:AS01:111:COOLING PP") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgnt.dbd") #! DBDEND record(ai, "MCOR:AS01:102:VACT") { field(DESC, "ADC Chan 1") field(SCAN, ".5 second") field(DTYP, "Hytec IP-ADC-8413") field(INP, "@ai0:1:DATA") field(PREC, "9") field(LINR, "LINEAR") field(EGUF, "10.0") field(EGUL, "-10.0") field(EGU, "V") field(HOPR, "10.0") field(LOPR, "-10.0") field(FLNK, "MCOR:AS01:102:IACT") } record(bo,"MCOR:AS01:102:CALBSETPT") { field(DESC, "Use ADC Calbration ") field(DTYP, "Hytec IP-ADC-8413") field(OUT, "@ai0:1:CAL") field(ZNAM, "Not-In-Use") field(ONAM, "In-Use") field(DOL, "1") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK,"MCOR:AS01:102:CALBSTATE") } record(bi, "MCOR:AS01:102:CALBSTATE") { field(DESC, "ADC Calibration Status") field(DTYP, "Hytec IP-ADC-8413") field(INP, "@ai0:1:CAL") field(ZNAM, "Not-In-Use") field(ONAM, "In-Use") } record(ao, "MCOR:AS01:102:ADCCHAN") { field(DESC, "ADC Chan") field(PINI, "YES") field(HOPR, "15") field(LOPR, "0") field(VAL, "1") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgnt.dbd") #! DBDEND record(ao, "MCOR:AS01:102:VSETPT") { field(DESC, "DAC ao0 Ch 1 Setpoint") field(DTYP, "ACROMAG-IP231") field(OUT, "@ao0:1:DATA") field(PREC, "9") field(EGUF, "10.0") field(EGUL, "-10.0") field(HOPR, "10.0") field(LOPR, "-10.0") field(EGU, "V") field(LINR, "LINEAR") field(DRVH, "10.0") field(DRVL, "-10.0") field(DOL, "MCOR:AS01:102:VSETPTCALC") field(OMSL, "closed_loop") } record(ai, "MCOR:AS01:102:DACCHAN") { field(DESC, "ADC ao0 Ch 1") field(PINI, "YES") field(HOPR, "15") field(LOPR, "0") field(VAL, "1") } record(stringout, "MCOR:AS01:102:DACCARDNAME") { field(DESC, "DAC ao0 Name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "ao0") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgnt.dbd") #! DBDEND record(ao, "MCOR:AS01:102:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(EGU, "A") field(PREC, "9") field(HOPR, "30") field(LOPR, "30") field(FLNK, "MCOR:AS01:102:VSETPTCALC") info(autosaveFields,"VAL") } record(calc, "MCOR:AS01:102:VSETPTCALC") { field(DESC, "Calc Voltage Setpoint") field(CALC, "(C*A)+B") field(INPA, "MCOR:AS01:102:I2VSLOPE") field(INPB, "0.0") field(INPC, "MCOR:AS01:102:ISETPT") field(EGU, "V") field(PREC, "9") field(FLNK, "MCOR:AS01:102:VSETPT") info(autosaveFields,"VAL") } record(calc, "MCOR:AS01:102:IACT") { field(DESC, "Calculate Actual Current") field(CALC, "(C*A)+B") field(INPA, "MCOR:AS01:102:V2ISLOPE") field(INPB, "0.0") field(INPC, "MCOR:AS01:102:VACT") field(EGU, "A") field(PREC, "9") # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # field(FLNK, "QUAD:AS01:121:IACT") } # Used for stepping DAC record(longout, "MCOR:AS01:102:DACSTEP") { field(DESC, "DAC steps") field(EGU, "DAC Counts") field(DRVH, "100") field(HOPR, "100") field(VAL, "3") field(FLNK, "MCOR:AS01:102:VSTEP") } record(calc, "MCOR:AS01:102:VSTEP") { field(DESC, "Step in volts") field(CALC, "B?((C-D)/B)*A:0") field(INPA, "MCOR:AS01:102:DACSTEP") field(INPB, "65535") field(INPC, "MCOR:AS01:102:VSETPT.HOPR") field(INPD, "MCOR:AS01:102:VSETPT.LOPR") field(EGU, "V") field(PREC, "9") field(FLNK, "MCOR:AS01:102:ISTEP") } record(calc, "MCOR:AS01:102:ISTEP") { field(DESC, "Step in I") field(CALC, "(C-D)==0?0:A*(B/(C-D))") field(INPA, "MCOR:AS01:102:VSTEP") field(INPB, "MCOR:AS01:102:VSTEP.C") field(INPC, "MCOR:AS01:102:IMAX_DAC") field(INPD, "MCOR:AS01:102:IMIN_DAC") field(EGU, "A") field(PREC, "9") # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # field(FLNK, "QUAD:AS01:121:TRIMSTEPMIN") } record(calc, "MCOR:AS01:102:V2ISLOPE") { field(DESC, "Slope for V to I conversion") field(CALC, "(C-D)==0?0:(A-B)/(C-D)") field(INPA, "MCOR:AS01:102:IMAX_ADC") field(INPB, "MCOR:AS01:102:IMIN_ADC") field(INPC, "MCOR:AS01:102:VSETPT.HOPR") field(INPD, "MCOR:AS01:102:VSETPT.LOPR") field(PREC, "9") } record(calcout, "MCOR:AS01:102:I2VSLOPE") { field(DESC, "Slope for I to V conversion") field(CALC, "(A-B)==0?0: (C-D)/(A-B)") field(INPA, "MCOR:AS01:102:IMAX_DAC") field(INPB, "MCOR:AS01:102:IMIN_DAC") field(INPC, "MCOR:AS01:102:VSETPT.HOPR") field(INPD, "MCOR:AS01:102:VSETPT.LOPR") field(PREC, "9") } # MCOR Power Module Type record(mbbo, "MCOR:AS01:102:TYPE") { field(DESC, "Chnl 1 Full Scale Output") field(DTYP, "Raw Soft Channel") field(NOBT, "3") field(ZRST, "Spare") field(ONST, "MCOR1") field(TWST, "MCOR2") field(THST, "MCOR6") field(FRST, "MCOR12") field(FVST, "MCOR30") field(ZRVL, "12") field(ONVL, "1") field(TWVL, "2") field(THVL, "6") field(FRVL, "12") field(FVVL, "30") field(PINI, "YES") field(VAL, "3") field(FLNK, "MCOR:AS01:102:IMAX_ADC") } record(calc, "MCOR:AS01:102:IMAX_ADC") { field(DESC, "Chnl 1 Full Scale Input") field(CALC, "(A=1)||(A=6)?A*2:A") field(INPA, "MCOR:AS01:102:TYPE.RVAL") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:102:IMIN_ADC") } record(calc, "MCOR:AS01:102:IMIN_ADC") { field(DESC, "Chnl 1 Min Curr Input") field(CALC, "-A") field(INPA, "MCOR:AS01:102:IMAX_ADC") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:102:IMIN_DAC") } record(calc, "MCOR:AS01:102:IMIN_DAC") { field(DESC, "Chnl 1 Min Curr Output") field(CALC, "-A") field(INPA, "MCOR:AS01:102:TYPE.RVAL") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:102:IMAX_DAC") } record(calc, "MCOR:AS01:102:IMAX_DAC") { field(DESC, "Chnl 1 Min Curr Output") field(CALC, "A") field(INPA, "MCOR:AS01:102:TYPE.RVAL") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:102:ILIMITS_DAC") } record(seq, "MCOR:AS01:102:ILIMITS_DAC") { field(DESC, "Set full scale range") field(ASG, "Internal") field(DOL1, "0") field(DOL2, "MCOR:AS01:102:IMAX_DAC") field(DOL3, "MCOR:AS01:102:IMIN_DAC") field(DOL4, "MCOR:AS01:102:IMAX_DAC") field(DOL5, "MCOR:AS01:102:IMIN_DAC") field(LNK1, "MCOR:AS01:102:I2VSLOPE.PROC") field(LNK2, "MCOR:AS01:102:ISETPT.DRVH") field(LNK3, "MCOR:AS01:102:ISETPT.DRVL") field(LNK4, "MCOR:AS01:102:ISETPT.HOPR") field(LNK5, "MCOR:AS01:102:ISETPT.LOPR PP" ) field(FLNK, "MCOR:AS01:102:ILIMITS_ADC") } record(seq, "MCOR:AS01:102:ILIMITS_ADC") { field(DESC, "Set full scale range") field(ASG, "Internal") field(DOL1, "0") field(DOL2, "MCOR:AS01:102:IMAX_ADC") field(DOL3, "MCOR:AS01:102:IMIN_ADC") field(DOL4, "0") field(LNK1, "MCOR:AS01:102:V2ISLOPE.PROC") field(LNK2, "MCOR:AS01:102:IACT.HOPR") field(LNK3, "MCOR:AS01:102:IACT.LOPR PP") field(LNK4, "MCOR:AS01:102:DACSTEP.PROC") } # Bulk Power Supply On/Off Status # BiRa MCOR controller does have capabiilty # to read the Bulk ps on/off control and status where as # the EMCOR Controller firmware does provided on/off bulok ps control # via backplane, and the EMCOR EPICS driver provides support. However, # this bulk on/off capabilty requires a hardware interface chassis between # the bulk and the MCOR crate, which has not been designed. Therefore # a soft pvs have been provided, which gets its data from another # pv that reads the bulk on/off status from the power supply (genesys) # directly or from a plc, which is connected to the power supply # on/off signal. The on/off status of each MCOR channel is generated from # this MCOR Bulk on/off status in combination with the MCOR Fault status # for this channel. The MCOR fault status is included because an MCOR # channel can be faulted while the bulk supply is on. # # SPECIAL CASE: # There are three (3) special cases of hardware configuration including # the hard and soft x-ray chicanes in the undulator and the xleap chicane # in the ltu. For these three (2) installations circuitry has been added # to provide a separate on/off control of individual mcor channels, which # is used by the chicane string main. This hardware includes a contactor # to provide the on/off control. The contactor which is controlled and # monitored by beckhoff digial i/o modules, to open/close the contactor # and to read the state of the contactor. For these three chicanes the # main mcor channel ps has an on/off control and status, separate from # the MCOR bulk status. If a contactor exists the PV for the on/off # is defined in the field INPE. Otherwise, this field is set to the # default(1), as shown below: # # INPE=1 - The default for all but ltu and und chicanes w/contactor # INPE=CONTACTOR_STATE CP # # The STATE_CALC pv is overloaded in mgntApp/Db/und/mgnt_und1_bkhf.substitutions # for the chicanes, which only instantiates the INPE field. # # VAL: (output value) # 0 - do nothing, unknown state # 1 - ps state off # 2 - ps state on # record(calcout, "MCOR:AS01:102:STATE_CALC") { field(DESC, "PS Status") # # If the bulk ps state is invalid, do nothing. If an the fault pv is invalid # output then set mcor chan state to the bulk state. If the bulk ps is on, the # mcor chan state is on, and the mcor chan is not faulted, then output set # mcor chan state to on (1). Otherwise, set the mcor chan state to off (0). # field(CALC, "A=3?0:D=3?3:A&&E&&(B=0)?2:1") field(OUT, "MCOR:AS01:102:STATE_SEQ.SELN PP") field(INPA, "MCOR:AS01:100:PS_STATE") field(INPB, "MCOR:AS01:102:INTLKSUMY CP") field(INPC, "MCOR:AS01:100:PS_STATE.SEVR") field(INPD, "MCOR:AS01:102:INTLKSUMY.SEVR") field(INPE, "1") } record(seq, "MCOR:AS01:102:STATE_SEQ") { field(DESC, "PS State Sequence") field(SELM, "Specified") field(DOL2, "1") field(DOL3, "MCOR:AS01:100:PS_STATE") field(LNK1, "MCOR:AS01:102:STATE PP") field(LNK2, "MCOR:AS01:102:STATE PP") field(LNK3, "MCOR:AS01:102:STATE PP") } record(bo, "MCOR:AS01:102:STATE") { field(DESC, "Bulk PS Status") field(ZNAM, "OFF") field(ONAM, "ON") # # If this is a spare mcor channel, instanciate the LNK macro with a "#" field(OUT, "QUAD:AS01:121:STATE PP MSS") } record(bo, "MCOR:AS01:102:TURNEDOFF") { field(DESC, "Bulk PS Turned Off by User") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "MCOR:AS01:100:PS_TURNEDOFF NPP MS") field(OMSL, "closed_loop") # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # field(OUT, "QUAD:AS01:121:TURNEDOFF PP MS") } # Bulk Power Supply On/Off Control # SLAC EMCOR controller does not have capabiilty # to control Bulk ps on/off. # Currently, this pv is just a place holder. record(bo, "MCOR:AS01:102:STATESETPT") { field(DESC, "PS On/Off Ctrl") field(DTYP, "Raw Soft Channel") field(ZNAM, "ON") field(ONAM, "OFF") field(OUT, "") } # MCOR fault status # Since the standard BiRa controller does not have a fault status # can only be read directly off of the backplane # that can be read from VME, the occurs if there is a power dip but the bulk has not tripped of. record(calcout, "MCOR:AS01:102:FAULTSTATE_CALC") { field(DESC, "MCOR Channel Fault Status") field(PINI, "YES") field(CALC, "A") field(OUT, "MCOR:AS01:102:FAULTSTATE PP") } record(bi, "MCOR:AS01:102:FAULTSTATE") { field(DESC, "Fault Status") field(DTYP, "Soft Channel") field(ZNAM, "OK") field(ONAM, "FAULTED") field(OSV, "MAJOR") field(FLNK, "MCOR:AS01:102:INTLKSUMY_CALC") } # If severity is invaild then output a zero (0) value record(calcout, "MCOR:AS01:102:INTLKSUMY_CALC") { field(DESC, "Interlock Summary Calculation") field(CALC, "A||B?1:0") field(INPA, "MCOR:AS01:102:FAULTSTATE NPP MSS") field(INPB, "MCOR:AS01:100:PS_LATCHED_FAULTSTATE NPP NMS") field(INPC, "MCOR:AS01:102:FAULTSTATE.SEVR CPP") field(IVOA, "Set output to IVOV") field(IVOV, "0") field(OUT, "MCOR:AS01:102:INTLKSUMY PP MSS") } record(bo, "MCOR:AS01:102:INTLKSUMY") { field(DESC, "Interlock Summary") field(DTYP, "Soft Channel") field(ZNAM, "OK") field(ONAM, "FAULTED") field(DOL, "MCOR:AS01:102:INTLKSUMY_CALC NPP MSS") field(OMSL, "closed_loop") # If this is a spare mcor channel, instanciate the LNK macro with a "#" field(OUT, "QUAD:AS01:121:INTLKSUMY PP MSS") } record(bo, "MCOR:AS01:102:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "NORESET") field(ONAM, "RESET") field(OUT, "MCOR:AS01:100:RESET PP") } # MCOR Crate Information # Note: this pv is use by the pau driver # for fast feedback. record(stringout, "MCOR:AS01:102:NAME") { field(DESC, "QUAD:AS01:121:") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, "CQ01S") } record(longout, "MCOR:AS01:102:CRATE") { field(DESC, "Crate 1") field(DTYP, "Soft Channel") field(HOPR, "4") field(LOPR, "1") field(PINI, "YES") field(VAL, "1") } record(longout, "MCOR:AS01:102:CHAN") { field(DESC, "Channel 1") field(DTYP, "Soft Channel") field(HOPR, "15") field(PINI, "YES") field(VAL, "1") } record(mbbo, "MCOR:AS01:102: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, "0") # # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # field(OUT, "QUAD:AS01:121:COOLING PP") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgnt.dbd") #! DBDEND record(ai, "MCOR:AS01:103:VACT") { field(DESC, "ADC Chan 2") field(SCAN, ".5 second") field(DTYP, "Hytec IP-ADC-8413") field(INP, "@ai0:2:DATA") field(PREC, "9") field(LINR, "LINEAR") field(EGUF, "10.0") field(EGUL, "-10.0") field(EGU, "V") field(HOPR, "10.0") field(LOPR, "-10.0") field(FLNK, "MCOR:AS01:103:IACT") } record(bo,"MCOR:AS01:103:CALBSETPT") { field(DESC, "Use ADC Calbration ") field(DTYP, "Hytec IP-ADC-8413") field(OUT, "@ai0:2:CAL") field(ZNAM, "Not-In-Use") field(ONAM, "In-Use") field(DOL, "1") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK,"MCOR:AS01:103:CALBSTATE") } record(bi, "MCOR:AS01:103:CALBSTATE") { field(DESC, "ADC Calibration Status") field(DTYP, "Hytec IP-ADC-8413") field(INP, "@ai0:2:CAL") field(ZNAM, "Not-In-Use") field(ONAM, "In-Use") } record(ao, "MCOR:AS01:103:ADCCHAN") { field(DESC, "ADC Chan") field(PINI, "YES") field(HOPR, "15") field(LOPR, "0") field(VAL, "2") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgnt.dbd") #! DBDEND record(ao, "MCOR:AS01:103:VSETPT") { field(DESC, "DAC ao0 Ch 2 Setpoint") field(DTYP, "ACROMAG-IP231") field(OUT, "@ao0:2:DATA") field(PREC, "9") field(EGUF, "10.0") field(EGUL, "-10.0") field(HOPR, "10.0") field(LOPR, "-10.0") field(EGU, "V") field(LINR, "LINEAR") field(DRVH, "10.0") field(DRVL, "-10.0") field(DOL, "MCOR:AS01:103:VSETPTCALC") field(OMSL, "closed_loop") } record(ai, "MCOR:AS01:103:DACCHAN") { field(DESC, "ADC ao0 Ch 2") field(PINI, "YES") field(HOPR, "15") field(LOPR, "0") field(VAL, "2") } record(stringout, "MCOR:AS01:103:DACCARDNAME") { field(DESC, "DAC ao0 Name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "ao0") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgnt.dbd") #! DBDEND record(ao, "MCOR:AS01:103:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(EGU, "A") field(PREC, "9") field(HOPR, "30") field(LOPR, "30") field(FLNK, "MCOR:AS01:103:VSETPTCALC") info(autosaveFields,"VAL") } record(calc, "MCOR:AS01:103:VSETPTCALC") { field(DESC, "Calc Voltage Setpoint") field(CALC, "(C*A)+B") field(INPA, "MCOR:AS01:103:I2VSLOPE") field(INPB, "0.0") field(INPC, "MCOR:AS01:103:ISETPT") field(EGU, "V") field(PREC, "9") field(FLNK, "MCOR:AS01:103:VSETPT") info(autosaveFields,"VAL") } record(calc, "MCOR:AS01:103:IACT") { field(DESC, "Calculate Actual Current") field(CALC, "(C*A)+B") field(INPA, "MCOR:AS01:103:V2ISLOPE") field(INPB, "0.0") field(INPC, "MCOR:AS01:103:VACT") field(EGU, "A") field(PREC, "9") # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # field(FLNK, "QUAD:AS01:122:IACT") } # Used for stepping DAC record(longout, "MCOR:AS01:103:DACSTEP") { field(DESC, "DAC steps") field(EGU, "DAC Counts") field(DRVH, "100") field(HOPR, "100") field(VAL, "3") field(FLNK, "MCOR:AS01:103:VSTEP") } record(calc, "MCOR:AS01:103:VSTEP") { field(DESC, "Step in volts") field(CALC, "B?((C-D)/B)*A:0") field(INPA, "MCOR:AS01:103:DACSTEP") field(INPB, "65535") field(INPC, "MCOR:AS01:103:VSETPT.HOPR") field(INPD, "MCOR:AS01:103:VSETPT.LOPR") field(EGU, "V") field(PREC, "9") field(FLNK, "MCOR:AS01:103:ISTEP") } record(calc, "MCOR:AS01:103:ISTEP") { field(DESC, "Step in I") field(CALC, "(C-D)==0?0:A*(B/(C-D))") field(INPA, "MCOR:AS01:103:VSTEP") field(INPB, "MCOR:AS01:103:VSTEP.C") field(INPC, "MCOR:AS01:103:IMAX_DAC") field(INPD, "MCOR:AS01:103:IMIN_DAC") field(EGU, "A") field(PREC, "9") # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # field(FLNK, "QUAD:AS01:122:TRIMSTEPMIN") } record(calc, "MCOR:AS01:103:V2ISLOPE") { field(DESC, "Slope for V to I conversion") field(CALC, "(C-D)==0?0:(A-B)/(C-D)") field(INPA, "MCOR:AS01:103:IMAX_ADC") field(INPB, "MCOR:AS01:103:IMIN_ADC") field(INPC, "MCOR:AS01:103:VSETPT.HOPR") field(INPD, "MCOR:AS01:103:VSETPT.LOPR") field(PREC, "9") } record(calcout, "MCOR:AS01:103:I2VSLOPE") { field(DESC, "Slope for I to V conversion") field(CALC, "(A-B)==0?0: (C-D)/(A-B)") field(INPA, "MCOR:AS01:103:IMAX_DAC") field(INPB, "MCOR:AS01:103:IMIN_DAC") field(INPC, "MCOR:AS01:103:VSETPT.HOPR") field(INPD, "MCOR:AS01:103:VSETPT.LOPR") field(PREC, "9") } # MCOR Power Module Type record(mbbo, "MCOR:AS01:103:TYPE") { field(DESC, "Chnl 2 Full Scale Output") field(DTYP, "Raw Soft Channel") field(NOBT, "3") field(ZRST, "Spare") field(ONST, "MCOR1") field(TWST, "MCOR2") field(THST, "MCOR6") field(FRST, "MCOR12") field(FVST, "MCOR30") field(ZRVL, "12") field(ONVL, "1") field(TWVL, "2") field(THVL, "6") field(FRVL, "12") field(FVVL, "30") field(PINI, "YES") field(VAL, "3") field(FLNK, "MCOR:AS01:103:IMAX_ADC") } record(calc, "MCOR:AS01:103:IMAX_ADC") { field(DESC, "Chnl 2 Full Scale Input") field(CALC, "(A=1)||(A=6)?A*2:A") field(INPA, "MCOR:AS01:103:TYPE.RVAL") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:103:IMIN_ADC") } record(calc, "MCOR:AS01:103:IMIN_ADC") { field(DESC, "Chnl 2 Min Curr Input") field(CALC, "-A") field(INPA, "MCOR:AS01:103:IMAX_ADC") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:103:IMIN_DAC") } record(calc, "MCOR:AS01:103:IMIN_DAC") { field(DESC, "Chnl 2 Min Curr Output") field(CALC, "-A") field(INPA, "MCOR:AS01:103:TYPE.RVAL") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:103:IMAX_DAC") } record(calc, "MCOR:AS01:103:IMAX_DAC") { field(DESC, "Chnl 2 Min Curr Output") field(CALC, "A") field(INPA, "MCOR:AS01:103:TYPE.RVAL") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:103:ILIMITS_DAC") } record(seq, "MCOR:AS01:103:ILIMITS_DAC") { field(DESC, "Set full scale range") field(ASG, "Internal") field(DOL1, "0") field(DOL2, "MCOR:AS01:103:IMAX_DAC") field(DOL3, "MCOR:AS01:103:IMIN_DAC") field(DOL4, "MCOR:AS01:103:IMAX_DAC") field(DOL5, "MCOR:AS01:103:IMIN_DAC") field(LNK1, "MCOR:AS01:103:I2VSLOPE.PROC") field(LNK2, "MCOR:AS01:103:ISETPT.DRVH") field(LNK3, "MCOR:AS01:103:ISETPT.DRVL") field(LNK4, "MCOR:AS01:103:ISETPT.HOPR") field(LNK5, "MCOR:AS01:103:ISETPT.LOPR PP" ) field(FLNK, "MCOR:AS01:103:ILIMITS_ADC") } record(seq, "MCOR:AS01:103:ILIMITS_ADC") { field(DESC, "Set full scale range") field(ASG, "Internal") field(DOL1, "0") field(DOL2, "MCOR:AS01:103:IMAX_ADC") field(DOL3, "MCOR:AS01:103:IMIN_ADC") field(DOL4, "0") field(LNK1, "MCOR:AS01:103:V2ISLOPE.PROC") field(LNK2, "MCOR:AS01:103:IACT.HOPR") field(LNK3, "MCOR:AS01:103:IACT.LOPR PP") field(LNK4, "MCOR:AS01:103:DACSTEP.PROC") } # Bulk Power Supply On/Off Status # BiRa MCOR controller does have capabiilty # to read the Bulk ps on/off control and status where as # the EMCOR Controller firmware does provided on/off bulok ps control # via backplane, and the EMCOR EPICS driver provides support. However, # this bulk on/off capabilty requires a hardware interface chassis between # the bulk and the MCOR crate, which has not been designed. Therefore # a soft pvs have been provided, which gets its data from another # pv that reads the bulk on/off status from the power supply (genesys) # directly or from a plc, which is connected to the power supply # on/off signal. The on/off status of each MCOR channel is generated from # this MCOR Bulk on/off status in combination with the MCOR Fault status # for this channel. The MCOR fault status is included because an MCOR # channel can be faulted while the bulk supply is on. # # SPECIAL CASE: # There are three (3) special cases of hardware configuration including # the hard and soft x-ray chicanes in the undulator and the xleap chicane # in the ltu. For these three (2) installations circuitry has been added # to provide a separate on/off control of individual mcor channels, which # is used by the chicane string main. This hardware includes a contactor # to provide the on/off control. The contactor which is controlled and # monitored by beckhoff digial i/o modules, to open/close the contactor # and to read the state of the contactor. For these three chicanes the # main mcor channel ps has an on/off control and status, separate from # the MCOR bulk status. If a contactor exists the PV for the on/off # is defined in the field INPE. Otherwise, this field is set to the # default(1), as shown below: # # INPE=1 - The default for all but ltu and und chicanes w/contactor # INPE=CONTACTOR_STATE CP # # The STATE_CALC pv is overloaded in mgntApp/Db/und/mgnt_und1_bkhf.substitutions # for the chicanes, which only instantiates the INPE field. # # VAL: (output value) # 0 - do nothing, unknown state # 1 - ps state off # 2 - ps state on # record(calcout, "MCOR:AS01:103:STATE_CALC") { field(DESC, "PS Status") # # If the bulk ps state is invalid, do nothing. If an the fault pv is invalid # output then set mcor chan state to the bulk state. If the bulk ps is on, the # mcor chan state is on, and the mcor chan is not faulted, then output set # mcor chan state to on (1). Otherwise, set the mcor chan state to off (0). # field(CALC, "A=3?0:D=3?3:A&&E&&(B=0)?2:1") field(OUT, "MCOR:AS01:103:STATE_SEQ.SELN PP") field(INPA, "MCOR:AS01:100:PS_STATE") field(INPB, "MCOR:AS01:103:INTLKSUMY CP") field(INPC, "MCOR:AS01:100:PS_STATE.SEVR") field(INPD, "MCOR:AS01:103:INTLKSUMY.SEVR") field(INPE, "1") } record(seq, "MCOR:AS01:103:STATE_SEQ") { field(DESC, "PS State Sequence") field(SELM, "Specified") field(DOL2, "1") field(DOL3, "MCOR:AS01:100:PS_STATE") field(LNK1, "MCOR:AS01:103:STATE PP") field(LNK2, "MCOR:AS01:103:STATE PP") field(LNK3, "MCOR:AS01:103:STATE PP") } record(bo, "MCOR:AS01:103:STATE") { field(DESC, "Bulk PS Status") field(ZNAM, "OFF") field(ONAM, "ON") # # If this is a spare mcor channel, instanciate the LNK macro with a "#" field(OUT, "QUAD:AS01:122:STATE PP MSS") } record(bo, "MCOR:AS01:103:TURNEDOFF") { field(DESC, "Bulk PS Turned Off by User") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "MCOR:AS01:100:PS_TURNEDOFF NPP MS") field(OMSL, "closed_loop") # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # field(OUT, "QUAD:AS01:122:TURNEDOFF PP MS") } # Bulk Power Supply On/Off Control # SLAC EMCOR controller does not have capabiilty # to control Bulk ps on/off. # Currently, this pv is just a place holder. record(bo, "MCOR:AS01:103:STATESETPT") { field(DESC, "PS On/Off Ctrl") field(DTYP, "Raw Soft Channel") field(ZNAM, "ON") field(ONAM, "OFF") field(OUT, "") } # MCOR fault status # Since the standard BiRa controller does not have a fault status # can only be read directly off of the backplane # that can be read from VME, the occurs if there is a power dip but the bulk has not tripped of. record(calcout, "MCOR:AS01:103:FAULTSTATE_CALC") { field(DESC, "MCOR Channel Fault Status") field(PINI, "YES") field(CALC, "A") field(OUT, "MCOR:AS01:103:FAULTSTATE PP") } record(bi, "MCOR:AS01:103:FAULTSTATE") { field(DESC, "Fault Status") field(DTYP, "Soft Channel") field(ZNAM, "OK") field(ONAM, "FAULTED") field(OSV, "MAJOR") field(FLNK, "MCOR:AS01:103:INTLKSUMY_CALC") } # If severity is invaild then output a zero (0) value record(calcout, "MCOR:AS01:103:INTLKSUMY_CALC") { field(DESC, "Interlock Summary Calculation") field(CALC, "A||B?1:0") field(INPA, "MCOR:AS01:103:FAULTSTATE NPP MSS") field(INPB, "MCOR:AS01:100:PS_LATCHED_FAULTSTATE NPP NMS") field(INPC, "MCOR:AS01:103:FAULTSTATE.SEVR CPP") field(IVOA, "Set output to IVOV") field(IVOV, "0") field(OUT, "MCOR:AS01:103:INTLKSUMY PP MSS") } record(bo, "MCOR:AS01:103:INTLKSUMY") { field(DESC, "Interlock Summary") field(DTYP, "Soft Channel") field(ZNAM, "OK") field(ONAM, "FAULTED") field(DOL, "MCOR:AS01:103:INTLKSUMY_CALC NPP MSS") field(OMSL, "closed_loop") # If this is a spare mcor channel, instanciate the LNK macro with a "#" field(OUT, "QUAD:AS01:122:INTLKSUMY PP MSS") } record(bo, "MCOR:AS01:103:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "NORESET") field(ONAM, "RESET") field(OUT, "MCOR:AS01:100:RESET PP") } # MCOR Crate Information # Note: this pv is use by the pau driver # for fast feedback. record(stringout, "MCOR:AS01:103:NAME") { field(DESC, "QUAD:AS01:122:") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, "SQ01S") } record(longout, "MCOR:AS01:103:CRATE") { field(DESC, "Crate 1") field(DTYP, "Soft Channel") field(HOPR, "4") field(LOPR, "1") field(PINI, "YES") field(VAL, "1") } record(longout, "MCOR:AS01:103:CHAN") { field(DESC, "Channel 2") field(DTYP, "Soft Channel") field(HOPR, "15") field(PINI, "YES") field(VAL, "2") } record(mbbo, "MCOR:AS01:103: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, "0") # # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # field(OUT, "QUAD:AS01:122:COOLING PP") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgnt.dbd") #! DBDEND record(ai, "MCOR:AS01:104:VACT") { field(DESC, "ADC Chan 3") field(SCAN, ".5 second") field(DTYP, "Hytec IP-ADC-8413") field(INP, "@ai0:3:DATA") field(PREC, "9") field(LINR, "LINEAR") field(EGUF, "10.0") field(EGUL, "-10.0") field(EGU, "V") field(HOPR, "10.0") field(LOPR, "-10.0") field(FLNK, "MCOR:AS01:104:IACT") } record(bo,"MCOR:AS01:104:CALBSETPT") { field(DESC, "Use ADC Calbration ") field(DTYP, "Hytec IP-ADC-8413") field(OUT, "@ai0:3:CAL") field(ZNAM, "Not-In-Use") field(ONAM, "In-Use") field(DOL, "1") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK,"MCOR:AS01:104:CALBSTATE") } record(bi, "MCOR:AS01:104:CALBSTATE") { field(DESC, "ADC Calibration Status") field(DTYP, "Hytec IP-ADC-8413") field(INP, "@ai0:3:CAL") field(ZNAM, "Not-In-Use") field(ONAM, "In-Use") } record(ao, "MCOR:AS01:104:ADCCHAN") { field(DESC, "ADC Chan") field(PINI, "YES") field(HOPR, "15") field(LOPR, "0") field(VAL, "3") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgnt.dbd") #! DBDEND record(ao, "MCOR:AS01:104:VSETPT") { field(DESC, "DAC ao0 Ch 3 Setpoint") field(DTYP, "ACROMAG-IP231") field(OUT, "@ao0:3:DATA") field(PREC, "9") field(EGUF, "10.0") field(EGUL, "-10.0") field(HOPR, "10.0") field(LOPR, "-10.0") field(EGU, "V") field(LINR, "LINEAR") field(DRVH, "10.0") field(DRVL, "-10.0") field(DOL, "MCOR:AS01:104:VSETPTCALC") field(OMSL, "closed_loop") } record(ai, "MCOR:AS01:104:DACCHAN") { field(DESC, "ADC ao0 Ch 3") field(PINI, "YES") field(HOPR, "15") field(LOPR, "0") field(VAL, "3") } record(stringout, "MCOR:AS01:104:DACCARDNAME") { field(DESC, "DAC ao0 Name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "ao0") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgnt.dbd") #! DBDEND record(ao, "MCOR:AS01:104:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(EGU, "A") field(PREC, "9") field(HOPR, "30") field(LOPR, "30") field(FLNK, "MCOR:AS01:104:VSETPTCALC") info(autosaveFields,"VAL") } record(calc, "MCOR:AS01:104:VSETPTCALC") { field(DESC, "Calc Voltage Setpoint") field(CALC, "(C*A)+B") field(INPA, "MCOR:AS01:104:I2VSLOPE") field(INPB, "0.0") field(INPC, "MCOR:AS01:104:ISETPT") field(EGU, "V") field(PREC, "9") field(FLNK, "MCOR:AS01:104:VSETPT") info(autosaveFields,"VAL") } record(calc, "MCOR:AS01:104:IACT") { field(DESC, "Calculate Actual Current") field(CALC, "(C*A)+B") field(INPA, "MCOR:AS01:104:V2ISLOPE") field(INPB, "0.0") field(INPC, "MCOR:AS01:104:VACT") field(EGU, "A") field(PREC, "9") # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # # field(FLNK, "IACT") } # Used for stepping DAC record(longout, "MCOR:AS01:104:DACSTEP") { field(DESC, "DAC steps") field(EGU, "DAC Counts") field(DRVH, "100") field(HOPR, "100") field(VAL, "3") field(FLNK, "MCOR:AS01:104:VSTEP") } record(calc, "MCOR:AS01:104:VSTEP") { field(DESC, "Step in volts") field(CALC, "B?((C-D)/B)*A:0") field(INPA, "MCOR:AS01:104:DACSTEP") field(INPB, "65535") field(INPC, "MCOR:AS01:104:VSETPT.HOPR") field(INPD, "MCOR:AS01:104:VSETPT.LOPR") field(EGU, "V") field(PREC, "9") field(FLNK, "MCOR:AS01:104:ISTEP") } record(calc, "MCOR:AS01:104:ISTEP") { field(DESC, "Step in I") field(CALC, "(C-D)==0?0:A*(B/(C-D))") field(INPA, "MCOR:AS01:104:VSTEP") field(INPB, "MCOR:AS01:104:VSTEP.C") field(INPC, "MCOR:AS01:104:IMAX_DAC") field(INPD, "MCOR:AS01:104:IMIN_DAC") field(EGU, "A") field(PREC, "9") # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # # field(FLNK, "TRIMSTEPMIN") } record(calc, "MCOR:AS01:104:V2ISLOPE") { field(DESC, "Slope for V to I conversion") field(CALC, "(C-D)==0?0:(A-B)/(C-D)") field(INPA, "MCOR:AS01:104:IMAX_ADC") field(INPB, "MCOR:AS01:104:IMIN_ADC") field(INPC, "MCOR:AS01:104:VSETPT.HOPR") field(INPD, "MCOR:AS01:104:VSETPT.LOPR") field(PREC, "9") } record(calcout, "MCOR:AS01:104:I2VSLOPE") { field(DESC, "Slope for I to V conversion") field(CALC, "(A-B)==0?0: (C-D)/(A-B)") field(INPA, "MCOR:AS01:104:IMAX_DAC") field(INPB, "MCOR:AS01:104:IMIN_DAC") field(INPC, "MCOR:AS01:104:VSETPT.HOPR") field(INPD, "MCOR:AS01:104:VSETPT.LOPR") field(PREC, "9") } # MCOR Power Module Type record(mbbo, "MCOR:AS01:104:TYPE") { field(DESC, "Chnl 3 Full Scale Output") field(DTYP, "Raw Soft Channel") field(NOBT, "3") field(ZRST, "Spare") field(ONST, "MCOR1") field(TWST, "MCOR2") field(THST, "MCOR6") field(FRST, "MCOR12") field(FVST, "MCOR30") field(ZRVL, "12") field(ONVL, "1") field(TWVL, "2") field(THVL, "6") field(FRVL, "12") field(FVVL, "30") field(PINI, "YES") field(VAL, "3") field(FLNK, "MCOR:AS01:104:IMAX_ADC") } record(calc, "MCOR:AS01:104:IMAX_ADC") { field(DESC, "Chnl 3 Full Scale Input") field(CALC, "(A=1)||(A=6)?A*2:A") field(INPA, "MCOR:AS01:104:TYPE.RVAL") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:104:IMIN_ADC") } record(calc, "MCOR:AS01:104:IMIN_ADC") { field(DESC, "Chnl 3 Min Curr Input") field(CALC, "-A") field(INPA, "MCOR:AS01:104:IMAX_ADC") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:104:IMIN_DAC") } record(calc, "MCOR:AS01:104:IMIN_DAC") { field(DESC, "Chnl 3 Min Curr Output") field(CALC, "-A") field(INPA, "MCOR:AS01:104:TYPE.RVAL") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:104:IMAX_DAC") } record(calc, "MCOR:AS01:104:IMAX_DAC") { field(DESC, "Chnl 3 Min Curr Output") field(CALC, "A") field(INPA, "MCOR:AS01:104:TYPE.RVAL") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:104:ILIMITS_DAC") } record(seq, "MCOR:AS01:104:ILIMITS_DAC") { field(DESC, "Set full scale range") field(ASG, "Internal") field(DOL1, "0") field(DOL2, "MCOR:AS01:104:IMAX_DAC") field(DOL3, "MCOR:AS01:104:IMIN_DAC") field(DOL4, "MCOR:AS01:104:IMAX_DAC") field(DOL5, "MCOR:AS01:104:IMIN_DAC") field(LNK1, "MCOR:AS01:104:I2VSLOPE.PROC") field(LNK2, "MCOR:AS01:104:ISETPT.DRVH") field(LNK3, "MCOR:AS01:104:ISETPT.DRVL") field(LNK4, "MCOR:AS01:104:ISETPT.HOPR") field(LNK5, "MCOR:AS01:104:ISETPT.LOPR PP" ) field(FLNK, "MCOR:AS01:104:ILIMITS_ADC") } record(seq, "MCOR:AS01:104:ILIMITS_ADC") { field(DESC, "Set full scale range") field(ASG, "Internal") field(DOL1, "0") field(DOL2, "MCOR:AS01:104:IMAX_ADC") field(DOL3, "MCOR:AS01:104:IMIN_ADC") field(DOL4, "0") field(LNK1, "MCOR:AS01:104:V2ISLOPE.PROC") field(LNK2, "MCOR:AS01:104:IACT.HOPR") field(LNK3, "MCOR:AS01:104:IACT.LOPR PP") field(LNK4, "MCOR:AS01:104:DACSTEP.PROC") } # Bulk Power Supply On/Off Status # BiRa MCOR controller does have capabiilty # to read the Bulk ps on/off control and status where as # the EMCOR Controller firmware does provided on/off bulok ps control # via backplane, and the EMCOR EPICS driver provides support. However, # this bulk on/off capabilty requires a hardware interface chassis between # the bulk and the MCOR crate, which has not been designed. Therefore # a soft pvs have been provided, which gets its data from another # pv that reads the bulk on/off status from the power supply (genesys) # directly or from a plc, which is connected to the power supply # on/off signal. The on/off status of each MCOR channel is generated from # this MCOR Bulk on/off status in combination with the MCOR Fault status # for this channel. The MCOR fault status is included because an MCOR # channel can be faulted while the bulk supply is on. # # SPECIAL CASE: # There are three (3) special cases of hardware configuration including # the hard and soft x-ray chicanes in the undulator and the xleap chicane # in the ltu. For these three (2) installations circuitry has been added # to provide a separate on/off control of individual mcor channels, which # is used by the chicane string main. This hardware includes a contactor # to provide the on/off control. The contactor which is controlled and # monitored by beckhoff digial i/o modules, to open/close the contactor # and to read the state of the contactor. For these three chicanes the # main mcor channel ps has an on/off control and status, separate from # the MCOR bulk status. If a contactor exists the PV for the on/off # is defined in the field INPE. Otherwise, this field is set to the # default(1), as shown below: # # INPE=1 - The default for all but ltu and und chicanes w/contactor # INPE=CONTACTOR_STATE CP # # The STATE_CALC pv is overloaded in mgntApp/Db/und/mgnt_und1_bkhf.substitutions # for the chicanes, which only instantiates the INPE field. # # VAL: (output value) # 0 - do nothing, unknown state # 1 - ps state off # 2 - ps state on # record(calcout, "MCOR:AS01:104:STATE_CALC") { field(DESC, "PS Status") # # If the bulk ps state is invalid, do nothing. If an the fault pv is invalid # output then set mcor chan state to the bulk state. If the bulk ps is on, the # mcor chan state is on, and the mcor chan is not faulted, then output set # mcor chan state to on (1). Otherwise, set the mcor chan state to off (0). # field(CALC, "A=3?0:D=3?3:A&&E&&(B=0)?2:1") field(OUT, "MCOR:AS01:104:STATE_SEQ.SELN PP") field(INPA, "MCOR:AS01:100:PS_STATE") field(INPB, "MCOR:AS01:104:INTLKSUMY CP") field(INPC, "MCOR:AS01:100:PS_STATE.SEVR") field(INPD, "MCOR:AS01:104:INTLKSUMY.SEVR") field(INPE, "1") } record(seq, "MCOR:AS01:104:STATE_SEQ") { field(DESC, "PS State Sequence") field(SELM, "Specified") field(DOL2, "1") field(DOL3, "MCOR:AS01:100:PS_STATE") field(LNK1, "MCOR:AS01:104:STATE PP") field(LNK2, "MCOR:AS01:104:STATE PP") field(LNK3, "MCOR:AS01:104:STATE PP") } record(bo, "MCOR:AS01:104:STATE") { field(DESC, "Bulk PS Status") field(ZNAM, "OFF") field(ONAM, "ON") # # If this is a spare mcor channel, instanciate the LNK macro with a "#" # field(OUT, "STATE PP MSS") } record(bo, "MCOR:AS01:104:TURNEDOFF") { field(DESC, "Bulk PS Turned Off by User") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "MCOR:AS01:100:PS_TURNEDOFF NPP MS") field(OMSL, "closed_loop") # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # # field(OUT, "TURNEDOFF PP MS") } # Bulk Power Supply On/Off Control # SLAC EMCOR controller does not have capabiilty # to control Bulk ps on/off. # Currently, this pv is just a place holder. record(bo, "MCOR:AS01:104:STATESETPT") { field(DESC, "PS On/Off Ctrl") field(DTYP, "Raw Soft Channel") field(ZNAM, "ON") field(ONAM, "OFF") field(OUT, "") } # MCOR fault status # Since the standard BiRa controller does not have a fault status # can only be read directly off of the backplane # that can be read from VME, the occurs if there is a power dip but the bulk has not tripped of. record(calcout, "MCOR:AS01:104:FAULTSTATE_CALC") { field(DESC, "MCOR Channel Fault Status") field(PINI, "YES") field(CALC, "A") field(OUT, "MCOR:AS01:104:FAULTSTATE PP") } record(bi, "MCOR:AS01:104:FAULTSTATE") { field(DESC, "Fault Status") field(DTYP, "Soft Channel") field(ZNAM, "OK") field(ONAM, "FAULTED") field(OSV, "MAJOR") field(FLNK, "MCOR:AS01:104:INTLKSUMY_CALC") } # If severity is invaild then output a zero (0) value record(calcout, "MCOR:AS01:104:INTLKSUMY_CALC") { field(DESC, "Interlock Summary Calculation") field(CALC, "A||B?1:0") field(INPA, "MCOR:AS01:104:FAULTSTATE NPP MSS") field(INPB, "MCOR:AS01:100:PS_LATCHED_FAULTSTATE NPP NMS") field(INPC, "MCOR:AS01:104:FAULTSTATE.SEVR CPP") field(IVOA, "Set output to IVOV") field(IVOV, "0") field(OUT, "MCOR:AS01:104:INTLKSUMY PP MSS") } record(bo, "MCOR:AS01:104:INTLKSUMY") { field(DESC, "Interlock Summary") field(DTYP, "Soft Channel") field(ZNAM, "OK") field(ONAM, "FAULTED") field(DOL, "MCOR:AS01:104:INTLKSUMY_CALC NPP MSS") field(OMSL, "closed_loop") # If this is a spare mcor channel, instanciate the LNK macro with a "#" # field(OUT, "INTLKSUMY PP MSS") } record(bo, "MCOR:AS01:104:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "NORESET") field(ONAM, "RESET") field(OUT, "MCOR:AS01:100:RESET PP") } # MCOR Crate Information # Note: this pv is use by the pau driver # for fast feedback. record(stringout, "MCOR:AS01:104:NAME") { field(DESC, "") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, "Spare") } record(longout, "MCOR:AS01:104:CRATE") { field(DESC, "Crate 1") field(DTYP, "Soft Channel") field(HOPR, "4") field(LOPR, "1") field(PINI, "YES") field(VAL, "1") } record(longout, "MCOR:AS01:104:CHAN") { field(DESC, "Channel 3") field(DTYP, "Soft Channel") field(HOPR, "15") field(PINI, "YES") field(VAL, "3") } record(mbbo, "MCOR:AS01:104: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, "0") # # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # # field(OUT, "COOLING PP") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgnt.dbd") #! DBDEND record(ai, "MCOR:AS01:105:VACT") { field(DESC, "ADC Chan 4") field(SCAN, ".5 second") field(DTYP, "Hytec IP-ADC-8413") field(INP, "@ai0:4:DATA") field(PREC, "9") field(LINR, "LINEAR") field(EGUF, "10.0") field(EGUL, "-10.0") field(EGU, "V") field(HOPR, "10.0") field(LOPR, "-10.0") field(FLNK, "MCOR:AS01:105:IACT") } record(bo,"MCOR:AS01:105:CALBSETPT") { field(DESC, "Use ADC Calbration ") field(DTYP, "Hytec IP-ADC-8413") field(OUT, "@ai0:4:CAL") field(ZNAM, "Not-In-Use") field(ONAM, "In-Use") field(DOL, "1") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK,"MCOR:AS01:105:CALBSTATE") } record(bi, "MCOR:AS01:105:CALBSTATE") { field(DESC, "ADC Calibration Status") field(DTYP, "Hytec IP-ADC-8413") field(INP, "@ai0:4:CAL") field(ZNAM, "Not-In-Use") field(ONAM, "In-Use") } record(ao, "MCOR:AS01:105:ADCCHAN") { field(DESC, "ADC Chan") field(PINI, "YES") field(HOPR, "15") field(LOPR, "0") field(VAL, "4") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgnt.dbd") #! DBDEND record(ao, "MCOR:AS01:105:VSETPT") { field(DESC, "DAC ao0 Ch 4 Setpoint") field(DTYP, "ACROMAG-IP231") field(OUT, "@ao0:4:DATA") field(PREC, "9") field(EGUF, "10.0") field(EGUL, "-10.0") field(HOPR, "10.0") field(LOPR, "-10.0") field(EGU, "V") field(LINR, "LINEAR") field(DRVH, "10.0") field(DRVL, "-10.0") field(DOL, "MCOR:AS01:105:VSETPTCALC") field(OMSL, "closed_loop") } record(ai, "MCOR:AS01:105:DACCHAN") { field(DESC, "ADC ao0 Ch 4") field(PINI, "YES") field(HOPR, "15") field(LOPR, "0") field(VAL, "4") } record(stringout, "MCOR:AS01:105:DACCARDNAME") { field(DESC, "DAC ao0 Name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "ao0") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgnt.dbd") #! DBDEND record(ao, "MCOR:AS01:105:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(EGU, "A") field(PREC, "9") field(HOPR, "30") field(LOPR, "30") field(FLNK, "MCOR:AS01:105:VSETPTCALC") info(autosaveFields,"VAL") } record(calc, "MCOR:AS01:105:VSETPTCALC") { field(DESC, "Calc Voltage Setpoint") field(CALC, "(C*A)+B") field(INPA, "MCOR:AS01:105:I2VSLOPE") field(INPB, "0.0") field(INPC, "MCOR:AS01:105:ISETPT") field(EGU, "V") field(PREC, "9") field(FLNK, "MCOR:AS01:105:VSETPT") info(autosaveFields,"VAL") } record(calc, "MCOR:AS01:105:IACT") { field(DESC, "Calculate Actual Current") field(CALC, "(C*A)+B") field(INPA, "MCOR:AS01:105:V2ISLOPE") field(INPB, "0.0") field(INPC, "MCOR:AS01:105:VACT") field(EGU, "A") field(PREC, "9") # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # field(FLNK, "XCOR:AS01:121:IACT") } # Used for stepping DAC record(longout, "MCOR:AS01:105:DACSTEP") { field(DESC, "DAC steps") field(EGU, "DAC Counts") field(DRVH, "100") field(HOPR, "100") field(VAL, "3") field(FLNK, "MCOR:AS01:105:VSTEP") } record(calc, "MCOR:AS01:105:VSTEP") { field(DESC, "Step in volts") field(CALC, "B?((C-D)/B)*A:0") field(INPA, "MCOR:AS01:105:DACSTEP") field(INPB, "65535") field(INPC, "MCOR:AS01:105:VSETPT.HOPR") field(INPD, "MCOR:AS01:105:VSETPT.LOPR") field(EGU, "V") field(PREC, "9") field(FLNK, "MCOR:AS01:105:ISTEP") } record(calc, "MCOR:AS01:105:ISTEP") { field(DESC, "Step in I") field(CALC, "(C-D)==0?0:A*(B/(C-D))") field(INPA, "MCOR:AS01:105:VSTEP") field(INPB, "MCOR:AS01:105:VSTEP.C") field(INPC, "MCOR:AS01:105:IMAX_DAC") field(INPD, "MCOR:AS01:105:IMIN_DAC") field(EGU, "A") field(PREC, "9") # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # field(FLNK, "XCOR:AS01:121:TRIMSTEPMIN") } record(calc, "MCOR:AS01:105:V2ISLOPE") { field(DESC, "Slope for V to I conversion") field(CALC, "(C-D)==0?0:(A-B)/(C-D)") field(INPA, "MCOR:AS01:105:IMAX_ADC") field(INPB, "MCOR:AS01:105:IMIN_ADC") field(INPC, "MCOR:AS01:105:VSETPT.HOPR") field(INPD, "MCOR:AS01:105:VSETPT.LOPR") field(PREC, "9") } record(calcout, "MCOR:AS01:105:I2VSLOPE") { field(DESC, "Slope for I to V conversion") field(CALC, "(A-B)==0?0: (C-D)/(A-B)") field(INPA, "MCOR:AS01:105:IMAX_DAC") field(INPB, "MCOR:AS01:105:IMIN_DAC") field(INPC, "MCOR:AS01:105:VSETPT.HOPR") field(INPD, "MCOR:AS01:105:VSETPT.LOPR") field(PREC, "9") } # MCOR Power Module Type record(mbbo, "MCOR:AS01:105:TYPE") { field(DESC, "Chnl 4 Full Scale Output") field(DTYP, "Raw Soft Channel") field(NOBT, "3") field(ZRST, "Spare") field(ONST, "MCOR1") field(TWST, "MCOR2") field(THST, "MCOR6") field(FRST, "MCOR12") field(FVST, "MCOR30") field(ZRVL, "12") field(ONVL, "1") field(TWVL, "2") field(THVL, "6") field(FRVL, "12") field(FVVL, "30") field(PINI, "YES") field(VAL, "3") field(FLNK, "MCOR:AS01:105:IMAX_ADC") } record(calc, "MCOR:AS01:105:IMAX_ADC") { field(DESC, "Chnl 4 Full Scale Input") field(CALC, "(A=1)||(A=6)?A*2:A") field(INPA, "MCOR:AS01:105:TYPE.RVAL") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:105:IMIN_ADC") } record(calc, "MCOR:AS01:105:IMIN_ADC") { field(DESC, "Chnl 4 Min Curr Input") field(CALC, "-A") field(INPA, "MCOR:AS01:105:IMAX_ADC") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:105:IMIN_DAC") } record(calc, "MCOR:AS01:105:IMIN_DAC") { field(DESC, "Chnl 4 Min Curr Output") field(CALC, "-A") field(INPA, "MCOR:AS01:105:TYPE.RVAL") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:105:IMAX_DAC") } record(calc, "MCOR:AS01:105:IMAX_DAC") { field(DESC, "Chnl 4 Min Curr Output") field(CALC, "A") field(INPA, "MCOR:AS01:105:TYPE.RVAL") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:105:ILIMITS_DAC") } record(seq, "MCOR:AS01:105:ILIMITS_DAC") { field(DESC, "Set full scale range") field(ASG, "Internal") field(DOL1, "0") field(DOL2, "MCOR:AS01:105:IMAX_DAC") field(DOL3, "MCOR:AS01:105:IMIN_DAC") field(DOL4, "MCOR:AS01:105:IMAX_DAC") field(DOL5, "MCOR:AS01:105:IMIN_DAC") field(LNK1, "MCOR:AS01:105:I2VSLOPE.PROC") field(LNK2, "MCOR:AS01:105:ISETPT.DRVH") field(LNK3, "MCOR:AS01:105:ISETPT.DRVL") field(LNK4, "MCOR:AS01:105:ISETPT.HOPR") field(LNK5, "MCOR:AS01:105:ISETPT.LOPR PP" ) field(FLNK, "MCOR:AS01:105:ILIMITS_ADC") } record(seq, "MCOR:AS01:105:ILIMITS_ADC") { field(DESC, "Set full scale range") field(ASG, "Internal") field(DOL1, "0") field(DOL2, "MCOR:AS01:105:IMAX_ADC") field(DOL3, "MCOR:AS01:105:IMIN_ADC") field(DOL4, "0") field(LNK1, "MCOR:AS01:105:V2ISLOPE.PROC") field(LNK2, "MCOR:AS01:105:IACT.HOPR") field(LNK3, "MCOR:AS01:105:IACT.LOPR PP") field(LNK4, "MCOR:AS01:105:DACSTEP.PROC") } # Bulk Power Supply On/Off Status # BiRa MCOR controller does have capabiilty # to read the Bulk ps on/off control and status where as # the EMCOR Controller firmware does provided on/off bulok ps control # via backplane, and the EMCOR EPICS driver provides support. However, # this bulk on/off capabilty requires a hardware interface chassis between # the bulk and the MCOR crate, which has not been designed. Therefore # a soft pvs have been provided, which gets its data from another # pv that reads the bulk on/off status from the power supply (genesys) # directly or from a plc, which is connected to the power supply # on/off signal. The on/off status of each MCOR channel is generated from # this MCOR Bulk on/off status in combination with the MCOR Fault status # for this channel. The MCOR fault status is included because an MCOR # channel can be faulted while the bulk supply is on. # # SPECIAL CASE: # There are three (3) special cases of hardware configuration including # the hard and soft x-ray chicanes in the undulator and the xleap chicane # in the ltu. For these three (2) installations circuitry has been added # to provide a separate on/off control of individual mcor channels, which # is used by the chicane string main. This hardware includes a contactor # to provide the on/off control. The contactor which is controlled and # monitored by beckhoff digial i/o modules, to open/close the contactor # and to read the state of the contactor. For these three chicanes the # main mcor channel ps has an on/off control and status, separate from # the MCOR bulk status. If a contactor exists the PV for the on/off # is defined in the field INPE. Otherwise, this field is set to the # default(1), as shown below: # # INPE=1 - The default for all but ltu and und chicanes w/contactor # INPE=CONTACTOR_STATE CP # # The STATE_CALC pv is overloaded in mgntApp/Db/und/mgnt_und1_bkhf.substitutions # for the chicanes, which only instantiates the INPE field. # # VAL: (output value) # 0 - do nothing, unknown state # 1 - ps state off # 2 - ps state on # record(calcout, "MCOR:AS01:105:STATE_CALC") { field(DESC, "PS Status") # # If the bulk ps state is invalid, do nothing. If an the fault pv is invalid # output then set mcor chan state to the bulk state. If the bulk ps is on, the # mcor chan state is on, and the mcor chan is not faulted, then output set # mcor chan state to on (1). Otherwise, set the mcor chan state to off (0). # field(CALC, "A=3?0:D=3?3:A&&E&&(B=0)?2:1") field(OUT, "MCOR:AS01:105:STATE_SEQ.SELN PP") field(INPA, "MCOR:AS01:100:PS_STATE") field(INPB, "MCOR:AS01:105:INTLKSUMY CP") field(INPC, "MCOR:AS01:100:PS_STATE.SEVR") field(INPD, "MCOR:AS01:105:INTLKSUMY.SEVR") field(INPE, "1") } record(seq, "MCOR:AS01:105:STATE_SEQ") { field(DESC, "PS State Sequence") field(SELM, "Specified") field(DOL2, "1") field(DOL3, "MCOR:AS01:100:PS_STATE") field(LNK1, "MCOR:AS01:105:STATE PP") field(LNK2, "MCOR:AS01:105:STATE PP") field(LNK3, "MCOR:AS01:105:STATE PP") } record(bo, "MCOR:AS01:105:STATE") { field(DESC, "Bulk PS Status") field(ZNAM, "OFF") field(ONAM, "ON") # # If this is a spare mcor channel, instanciate the LNK macro with a "#" field(OUT, "XCOR:AS01:121:STATE PP MSS") } record(bo, "MCOR:AS01:105:TURNEDOFF") { field(DESC, "Bulk PS Turned Off by User") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "MCOR:AS01:100:PS_TURNEDOFF NPP MS") field(OMSL, "closed_loop") # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # field(OUT, "XCOR:AS01:121:TURNEDOFF PP MS") } # Bulk Power Supply On/Off Control # SLAC EMCOR controller does not have capabiilty # to control Bulk ps on/off. # Currently, this pv is just a place holder. record(bo, "MCOR:AS01:105:STATESETPT") { field(DESC, "PS On/Off Ctrl") field(DTYP, "Raw Soft Channel") field(ZNAM, "ON") field(ONAM, "OFF") field(OUT, "") } # MCOR fault status # Since the standard BiRa controller does not have a fault status # can only be read directly off of the backplane # that can be read from VME, the occurs if there is a power dip but the bulk has not tripped of. record(calcout, "MCOR:AS01:105:FAULTSTATE_CALC") { field(DESC, "MCOR Channel Fault Status") field(PINI, "YES") field(CALC, "A") field(OUT, "MCOR:AS01:105:FAULTSTATE PP") } record(bi, "MCOR:AS01:105:FAULTSTATE") { field(DESC, "Fault Status") field(DTYP, "Soft Channel") field(ZNAM, "OK") field(ONAM, "FAULTED") field(OSV, "MAJOR") field(FLNK, "MCOR:AS01:105:INTLKSUMY_CALC") } # If severity is invaild then output a zero (0) value record(calcout, "MCOR:AS01:105:INTLKSUMY_CALC") { field(DESC, "Interlock Summary Calculation") field(CALC, "A||B?1:0") field(INPA, "MCOR:AS01:105:FAULTSTATE NPP MSS") field(INPB, "MCOR:AS01:100:PS_LATCHED_FAULTSTATE NPP NMS") field(INPC, "MCOR:AS01:105:FAULTSTATE.SEVR CPP") field(IVOA, "Set output to IVOV") field(IVOV, "0") field(OUT, "MCOR:AS01:105:INTLKSUMY PP MSS") } record(bo, "MCOR:AS01:105:INTLKSUMY") { field(DESC, "Interlock Summary") field(DTYP, "Soft Channel") field(ZNAM, "OK") field(ONAM, "FAULTED") field(DOL, "MCOR:AS01:105:INTLKSUMY_CALC NPP MSS") field(OMSL, "closed_loop") # If this is a spare mcor channel, instanciate the LNK macro with a "#" field(OUT, "XCOR:AS01:121:INTLKSUMY PP MSS") } record(bo, "MCOR:AS01:105:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "NORESET") field(ONAM, "RESET") field(OUT, "MCOR:AS01:100:RESET PP") } # MCOR Crate Information # Note: this pv is use by the pau driver # for fast feedback. record(stringout, "MCOR:AS01:105:NAME") { field(DESC, "XCOR:AS01:121:") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, "XC00S") } record(longout, "MCOR:AS01:105:CRATE") { field(DESC, "Crate 1") field(DTYP, "Soft Channel") field(HOPR, "4") field(LOPR, "1") field(PINI, "YES") field(VAL, "1") } record(longout, "MCOR:AS01:105:CHAN") { field(DESC, "Channel 4") field(DTYP, "Soft Channel") field(HOPR, "15") field(PINI, "YES") field(VAL, "4") } record(mbbo, "MCOR:AS01:105: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, "0") # # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # field(OUT, "XCOR:AS01:121:COOLING PP") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgnt.dbd") #! DBDEND record(ai, "MCOR:AS01:106:VACT") { field(DESC, "ADC Chan 5") field(SCAN, ".5 second") field(DTYP, "Hytec IP-ADC-8413") field(INP, "@ai0:5:DATA") field(PREC, "9") field(LINR, "LINEAR") field(EGUF, "10.0") field(EGUL, "-10.0") field(EGU, "V") field(HOPR, "10.0") field(LOPR, "-10.0") field(FLNK, "MCOR:AS01:106:IACT") } record(bo,"MCOR:AS01:106:CALBSETPT") { field(DESC, "Use ADC Calbration ") field(DTYP, "Hytec IP-ADC-8413") field(OUT, "@ai0:5:CAL") field(ZNAM, "Not-In-Use") field(ONAM, "In-Use") field(DOL, "1") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK,"MCOR:AS01:106:CALBSTATE") } record(bi, "MCOR:AS01:106:CALBSTATE") { field(DESC, "ADC Calibration Status") field(DTYP, "Hytec IP-ADC-8413") field(INP, "@ai0:5:CAL") field(ZNAM, "Not-In-Use") field(ONAM, "In-Use") } record(ao, "MCOR:AS01:106:ADCCHAN") { field(DESC, "ADC Chan") field(PINI, "YES") field(HOPR, "15") field(LOPR, "0") field(VAL, "5") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgnt.dbd") #! DBDEND record(ao, "MCOR:AS01:106:VSETPT") { field(DESC, "DAC ao0 Ch 5 Setpoint") field(DTYP, "ACROMAG-IP231") field(OUT, "@ao0:5:DATA") field(PREC, "9") field(EGUF, "10.0") field(EGUL, "-10.0") field(HOPR, "10.0") field(LOPR, "-10.0") field(EGU, "V") field(LINR, "LINEAR") field(DRVH, "10.0") field(DRVL, "-10.0") field(DOL, "MCOR:AS01:106:VSETPTCALC") field(OMSL, "closed_loop") } record(ai, "MCOR:AS01:106:DACCHAN") { field(DESC, "ADC ao0 Ch 5") field(PINI, "YES") field(HOPR, "15") field(LOPR, "0") field(VAL, "5") } record(stringout, "MCOR:AS01:106:DACCARDNAME") { field(DESC, "DAC ao0 Name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "ao0") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgnt.dbd") #! DBDEND record(ao, "MCOR:AS01:106:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(EGU, "A") field(PREC, "9") field(HOPR, "30") field(LOPR, "30") field(FLNK, "MCOR:AS01:106:VSETPTCALC") info(autosaveFields,"VAL") } record(calc, "MCOR:AS01:106:VSETPTCALC") { field(DESC, "Calc Voltage Setpoint") field(CALC, "(C*A)+B") field(INPA, "MCOR:AS01:106:I2VSLOPE") field(INPB, "0.0") field(INPC, "MCOR:AS01:106:ISETPT") field(EGU, "V") field(PREC, "9") field(FLNK, "MCOR:AS01:106:VSETPT") info(autosaveFields,"VAL") } record(calc, "MCOR:AS01:106:IACT") { field(DESC, "Calculate Actual Current") field(CALC, "(C*A)+B") field(INPA, "MCOR:AS01:106:V2ISLOPE") field(INPB, "0.0") field(INPC, "MCOR:AS01:106:VACT") field(EGU, "A") field(PREC, "9") # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # field(FLNK, "YCOR:AS01:122:IACT") } # Used for stepping DAC record(longout, "MCOR:AS01:106:DACSTEP") { field(DESC, "DAC steps") field(EGU, "DAC Counts") field(DRVH, "100") field(HOPR, "100") field(VAL, "3") field(FLNK, "MCOR:AS01:106:VSTEP") } record(calc, "MCOR:AS01:106:VSTEP") { field(DESC, "Step in volts") field(CALC, "B?((C-D)/B)*A:0") field(INPA, "MCOR:AS01:106:DACSTEP") field(INPB, "65535") field(INPC, "MCOR:AS01:106:VSETPT.HOPR") field(INPD, "MCOR:AS01:106:VSETPT.LOPR") field(EGU, "V") field(PREC, "9") field(FLNK, "MCOR:AS01:106:ISTEP") } record(calc, "MCOR:AS01:106:ISTEP") { field(DESC, "Step in I") field(CALC, "(C-D)==0?0:A*(B/(C-D))") field(INPA, "MCOR:AS01:106:VSTEP") field(INPB, "MCOR:AS01:106:VSTEP.C") field(INPC, "MCOR:AS01:106:IMAX_DAC") field(INPD, "MCOR:AS01:106:IMIN_DAC") field(EGU, "A") field(PREC, "9") # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # field(FLNK, "YCOR:AS01:122:TRIMSTEPMIN") } record(calc, "MCOR:AS01:106:V2ISLOPE") { field(DESC, "Slope for V to I conversion") field(CALC, "(C-D)==0?0:(A-B)/(C-D)") field(INPA, "MCOR:AS01:106:IMAX_ADC") field(INPB, "MCOR:AS01:106:IMIN_ADC") field(INPC, "MCOR:AS01:106:VSETPT.HOPR") field(INPD, "MCOR:AS01:106:VSETPT.LOPR") field(PREC, "9") } record(calcout, "MCOR:AS01:106:I2VSLOPE") { field(DESC, "Slope for I to V conversion") field(CALC, "(A-B)==0?0: (C-D)/(A-B)") field(INPA, "MCOR:AS01:106:IMAX_DAC") field(INPB, "MCOR:AS01:106:IMIN_DAC") field(INPC, "MCOR:AS01:106:VSETPT.HOPR") field(INPD, "MCOR:AS01:106:VSETPT.LOPR") field(PREC, "9") } # MCOR Power Module Type record(mbbo, "MCOR:AS01:106:TYPE") { field(DESC, "Chnl 5 Full Scale Output") field(DTYP, "Raw Soft Channel") field(NOBT, "3") field(ZRST, "Spare") field(ONST, "MCOR1") field(TWST, "MCOR2") field(THST, "MCOR6") field(FRST, "MCOR12") field(FVST, "MCOR30") field(ZRVL, "12") field(ONVL, "1") field(TWVL, "2") field(THVL, "6") field(FRVL, "12") field(FVVL, "30") field(PINI, "YES") field(VAL, "3") field(FLNK, "MCOR:AS01:106:IMAX_ADC") } record(calc, "MCOR:AS01:106:IMAX_ADC") { field(DESC, "Chnl 5 Full Scale Input") field(CALC, "(A=1)||(A=6)?A*2:A") field(INPA, "MCOR:AS01:106:TYPE.RVAL") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:106:IMIN_ADC") } record(calc, "MCOR:AS01:106:IMIN_ADC") { field(DESC, "Chnl 5 Min Curr Input") field(CALC, "-A") field(INPA, "MCOR:AS01:106:IMAX_ADC") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:106:IMIN_DAC") } record(calc, "MCOR:AS01:106:IMIN_DAC") { field(DESC, "Chnl 5 Min Curr Output") field(CALC, "-A") field(INPA, "MCOR:AS01:106:TYPE.RVAL") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:106:IMAX_DAC") } record(calc, "MCOR:AS01:106:IMAX_DAC") { field(DESC, "Chnl 5 Min Curr Output") field(CALC, "A") field(INPA, "MCOR:AS01:106:TYPE.RVAL") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:106:ILIMITS_DAC") } record(seq, "MCOR:AS01:106:ILIMITS_DAC") { field(DESC, "Set full scale range") field(ASG, "Internal") field(DOL1, "0") field(DOL2, "MCOR:AS01:106:IMAX_DAC") field(DOL3, "MCOR:AS01:106:IMIN_DAC") field(DOL4, "MCOR:AS01:106:IMAX_DAC") field(DOL5, "MCOR:AS01:106:IMIN_DAC") field(LNK1, "MCOR:AS01:106:I2VSLOPE.PROC") field(LNK2, "MCOR:AS01:106:ISETPT.DRVH") field(LNK3, "MCOR:AS01:106:ISETPT.DRVL") field(LNK4, "MCOR:AS01:106:ISETPT.HOPR") field(LNK5, "MCOR:AS01:106:ISETPT.LOPR PP" ) field(FLNK, "MCOR:AS01:106:ILIMITS_ADC") } record(seq, "MCOR:AS01:106:ILIMITS_ADC") { field(DESC, "Set full scale range") field(ASG, "Internal") field(DOL1, "0") field(DOL2, "MCOR:AS01:106:IMAX_ADC") field(DOL3, "MCOR:AS01:106:IMIN_ADC") field(DOL4, "0") field(LNK1, "MCOR:AS01:106:V2ISLOPE.PROC") field(LNK2, "MCOR:AS01:106:IACT.HOPR") field(LNK3, "MCOR:AS01:106:IACT.LOPR PP") field(LNK4, "MCOR:AS01:106:DACSTEP.PROC") } # Bulk Power Supply On/Off Status # BiRa MCOR controller does have capabiilty # to read the Bulk ps on/off control and status where as # the EMCOR Controller firmware does provided on/off bulok ps control # via backplane, and the EMCOR EPICS driver provides support. However, # this bulk on/off capabilty requires a hardware interface chassis between # the bulk and the MCOR crate, which has not been designed. Therefore # a soft pvs have been provided, which gets its data from another # pv that reads the bulk on/off status from the power supply (genesys) # directly or from a plc, which is connected to the power supply # on/off signal. The on/off status of each MCOR channel is generated from # this MCOR Bulk on/off status in combination with the MCOR Fault status # for this channel. The MCOR fault status is included because an MCOR # channel can be faulted while the bulk supply is on. # # SPECIAL CASE: # There are three (3) special cases of hardware configuration including # the hard and soft x-ray chicanes in the undulator and the xleap chicane # in the ltu. For these three (2) installations circuitry has been added # to provide a separate on/off control of individual mcor channels, which # is used by the chicane string main. This hardware includes a contactor # to provide the on/off control. The contactor which is controlled and # monitored by beckhoff digial i/o modules, to open/close the contactor # and to read the state of the contactor. For these three chicanes the # main mcor channel ps has an on/off control and status, separate from # the MCOR bulk status. If a contactor exists the PV for the on/off # is defined in the field INPE. Otherwise, this field is set to the # default(1), as shown below: # # INPE=1 - The default for all but ltu and und chicanes w/contactor # INPE=CONTACTOR_STATE CP # # The STATE_CALC pv is overloaded in mgntApp/Db/und/mgnt_und1_bkhf.substitutions # for the chicanes, which only instantiates the INPE field. # # VAL: (output value) # 0 - do nothing, unknown state # 1 - ps state off # 2 - ps state on # record(calcout, "MCOR:AS01:106:STATE_CALC") { field(DESC, "PS Status") # # If the bulk ps state is invalid, do nothing. If an the fault pv is invalid # output then set mcor chan state to the bulk state. If the bulk ps is on, the # mcor chan state is on, and the mcor chan is not faulted, then output set # mcor chan state to on (1). Otherwise, set the mcor chan state to off (0). # field(CALC, "A=3?0:D=3?3:A&&E&&(B=0)?2:1") field(OUT, "MCOR:AS01:106:STATE_SEQ.SELN PP") field(INPA, "MCOR:AS01:100:PS_STATE") field(INPB, "MCOR:AS01:106:INTLKSUMY CP") field(INPC, "MCOR:AS01:100:PS_STATE.SEVR") field(INPD, "MCOR:AS01:106:INTLKSUMY.SEVR") field(INPE, "1") } record(seq, "MCOR:AS01:106:STATE_SEQ") { field(DESC, "PS State Sequence") field(SELM, "Specified") field(DOL2, "1") field(DOL3, "MCOR:AS01:100:PS_STATE") field(LNK1, "MCOR:AS01:106:STATE PP") field(LNK2, "MCOR:AS01:106:STATE PP") field(LNK3, "MCOR:AS01:106:STATE PP") } record(bo, "MCOR:AS01:106:STATE") { field(DESC, "Bulk PS Status") field(ZNAM, "OFF") field(ONAM, "ON") # # If this is a spare mcor channel, instanciate the LNK macro with a "#" field(OUT, "YCOR:AS01:122:STATE PP MSS") } record(bo, "MCOR:AS01:106:TURNEDOFF") { field(DESC, "Bulk PS Turned Off by User") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "MCOR:AS01:100:PS_TURNEDOFF NPP MS") field(OMSL, "closed_loop") # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # field(OUT, "YCOR:AS01:122:TURNEDOFF PP MS") } # Bulk Power Supply On/Off Control # SLAC EMCOR controller does not have capabiilty # to control Bulk ps on/off. # Currently, this pv is just a place holder. record(bo, "MCOR:AS01:106:STATESETPT") { field(DESC, "PS On/Off Ctrl") field(DTYP, "Raw Soft Channel") field(ZNAM, "ON") field(ONAM, "OFF") field(OUT, "") } # MCOR fault status # Since the standard BiRa controller does not have a fault status # can only be read directly off of the backplane # that can be read from VME, the occurs if there is a power dip but the bulk has not tripped of. record(calcout, "MCOR:AS01:106:FAULTSTATE_CALC") { field(DESC, "MCOR Channel Fault Status") field(PINI, "YES") field(CALC, "A") field(OUT, "MCOR:AS01:106:FAULTSTATE PP") } record(bi, "MCOR:AS01:106:FAULTSTATE") { field(DESC, "Fault Status") field(DTYP, "Soft Channel") field(ZNAM, "OK") field(ONAM, "FAULTED") field(OSV, "MAJOR") field(FLNK, "MCOR:AS01:106:INTLKSUMY_CALC") } # If severity is invaild then output a zero (0) value record(calcout, "MCOR:AS01:106:INTLKSUMY_CALC") { field(DESC, "Interlock Summary Calculation") field(CALC, "A||B?1:0") field(INPA, "MCOR:AS01:106:FAULTSTATE NPP MSS") field(INPB, "MCOR:AS01:100:PS_LATCHED_FAULTSTATE NPP NMS") field(INPC, "MCOR:AS01:106:FAULTSTATE.SEVR CPP") field(IVOA, "Set output to IVOV") field(IVOV, "0") field(OUT, "MCOR:AS01:106:INTLKSUMY PP MSS") } record(bo, "MCOR:AS01:106:INTLKSUMY") { field(DESC, "Interlock Summary") field(DTYP, "Soft Channel") field(ZNAM, "OK") field(ONAM, "FAULTED") field(DOL, "MCOR:AS01:106:INTLKSUMY_CALC NPP MSS") field(OMSL, "closed_loop") # If this is a spare mcor channel, instanciate the LNK macro with a "#" field(OUT, "YCOR:AS01:122:INTLKSUMY PP MSS") } record(bo, "MCOR:AS01:106:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "NORESET") field(ONAM, "RESET") field(OUT, "MCOR:AS01:100:RESET PP") } # MCOR Crate Information # Note: this pv is use by the pau driver # for fast feedback. record(stringout, "MCOR:AS01:106:NAME") { field(DESC, "YCOR:AS01:122:") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, "YC00S") } record(longout, "MCOR:AS01:106:CRATE") { field(DESC, "Crate 1") field(DTYP, "Soft Channel") field(HOPR, "4") field(LOPR, "1") field(PINI, "YES") field(VAL, "1") } record(longout, "MCOR:AS01:106:CHAN") { field(DESC, "Channel 5") field(DTYP, "Soft Channel") field(HOPR, "15") field(PINI, "YES") field(VAL, "5") } record(mbbo, "MCOR:AS01:106: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, "0") # # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # field(OUT, "YCOR:AS01:122:COOLING PP") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgnt.dbd") #! DBDEND record(ai, "MCOR:AS01:107:VACT") { field(DESC, "ADC Chan 6") field(SCAN, ".5 second") field(DTYP, "Hytec IP-ADC-8413") field(INP, "@ai0:6:DATA") field(PREC, "9") field(LINR, "LINEAR") field(EGUF, "10.0") field(EGUL, "-10.0") field(EGU, "V") field(HOPR, "10.0") field(LOPR, "-10.0") field(FLNK, "MCOR:AS01:107:IACT") } record(bo,"MCOR:AS01:107:CALBSETPT") { field(DESC, "Use ADC Calbration ") field(DTYP, "Hytec IP-ADC-8413") field(OUT, "@ai0:6:CAL") field(ZNAM, "Not-In-Use") field(ONAM, "In-Use") field(DOL, "1") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK,"MCOR:AS01:107:CALBSTATE") } record(bi, "MCOR:AS01:107:CALBSTATE") { field(DESC, "ADC Calibration Status") field(DTYP, "Hytec IP-ADC-8413") field(INP, "@ai0:6:CAL") field(ZNAM, "Not-In-Use") field(ONAM, "In-Use") } record(ao, "MCOR:AS01:107:ADCCHAN") { field(DESC, "ADC Chan") field(PINI, "YES") field(HOPR, "15") field(LOPR, "0") field(VAL, "6") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgnt.dbd") #! DBDEND record(ao, "MCOR:AS01:107:VSETPT") { field(DESC, "DAC ao0 Ch 6 Setpoint") field(DTYP, "ACROMAG-IP231") field(OUT, "@ao0:6:DATA") field(PREC, "9") field(EGUF, "10.0") field(EGUL, "-10.0") field(HOPR, "10.0") field(LOPR, "-10.0") field(EGU, "V") field(LINR, "LINEAR") field(DRVH, "10.0") field(DRVL, "-10.0") field(DOL, "MCOR:AS01:107:VSETPTCALC") field(OMSL, "closed_loop") } record(ai, "MCOR:AS01:107:DACCHAN") { field(DESC, "ADC ao0 Ch 6") field(PINI, "YES") field(HOPR, "15") field(LOPR, "0") field(VAL, "6") } record(stringout, "MCOR:AS01:107:DACCARDNAME") { field(DESC, "DAC ao0 Name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "ao0") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgnt.dbd") #! DBDEND record(ao, "MCOR:AS01:107:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(EGU, "A") field(PREC, "9") field(HOPR, "30") field(LOPR, "30") field(FLNK, "MCOR:AS01:107:VSETPTCALC") info(autosaveFields,"VAL") } record(calc, "MCOR:AS01:107:VSETPTCALC") { field(DESC, "Calc Voltage Setpoint") field(CALC, "(C*A)+B") field(INPA, "MCOR:AS01:107:I2VSLOPE") field(INPB, "0.0") field(INPC, "MCOR:AS01:107:ISETPT") field(EGU, "V") field(PREC, "9") field(FLNK, "MCOR:AS01:107:VSETPT") info(autosaveFields,"VAL") } record(calc, "MCOR:AS01:107:IACT") { field(DESC, "Calculate Actual Current") field(CALC, "(C*A)+B") field(INPA, "MCOR:AS01:107:V2ISLOPE") field(INPB, "0.0") field(INPC, "MCOR:AS01:107:VACT") field(EGU, "A") field(PREC, "9") # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # field(FLNK, "XCOR:AS01:221:IACT") } # Used for stepping DAC record(longout, "MCOR:AS01:107:DACSTEP") { field(DESC, "DAC steps") field(EGU, "DAC Counts") field(DRVH, "100") field(HOPR, "100") field(VAL, "3") field(FLNK, "MCOR:AS01:107:VSTEP") } record(calc, "MCOR:AS01:107:VSTEP") { field(DESC, "Step in volts") field(CALC, "B?((C-D)/B)*A:0") field(INPA, "MCOR:AS01:107:DACSTEP") field(INPB, "65535") field(INPC, "MCOR:AS01:107:VSETPT.HOPR") field(INPD, "MCOR:AS01:107:VSETPT.LOPR") field(EGU, "V") field(PREC, "9") field(FLNK, "MCOR:AS01:107:ISTEP") } record(calc, "MCOR:AS01:107:ISTEP") { field(DESC, "Step in I") field(CALC, "(C-D)==0?0:A*(B/(C-D))") field(INPA, "MCOR:AS01:107:VSTEP") field(INPB, "MCOR:AS01:107:VSTEP.C") field(INPC, "MCOR:AS01:107:IMAX_DAC") field(INPD, "MCOR:AS01:107:IMIN_DAC") field(EGU, "A") field(PREC, "9") # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # field(FLNK, "XCOR:AS01:221:TRIMSTEPMIN") } record(calc, "MCOR:AS01:107:V2ISLOPE") { field(DESC, "Slope for V to I conversion") field(CALC, "(C-D)==0?0:(A-B)/(C-D)") field(INPA, "MCOR:AS01:107:IMAX_ADC") field(INPB, "MCOR:AS01:107:IMIN_ADC") field(INPC, "MCOR:AS01:107:VSETPT.HOPR") field(INPD, "MCOR:AS01:107:VSETPT.LOPR") field(PREC, "9") } record(calcout, "MCOR:AS01:107:I2VSLOPE") { field(DESC, "Slope for I to V conversion") field(CALC, "(A-B)==0?0: (C-D)/(A-B)") field(INPA, "MCOR:AS01:107:IMAX_DAC") field(INPB, "MCOR:AS01:107:IMIN_DAC") field(INPC, "MCOR:AS01:107:VSETPT.HOPR") field(INPD, "MCOR:AS01:107:VSETPT.LOPR") field(PREC, "9") } # MCOR Power Module Type record(mbbo, "MCOR:AS01:107:TYPE") { field(DESC, "Chnl 6 Full Scale Output") field(DTYP, "Raw Soft Channel") field(NOBT, "3") field(ZRST, "Spare") field(ONST, "MCOR1") field(TWST, "MCOR2") field(THST, "MCOR6") field(FRST, "MCOR12") field(FVST, "MCOR30") field(ZRVL, "12") field(ONVL, "1") field(TWVL, "2") field(THVL, "6") field(FRVL, "12") field(FVVL, "30") field(PINI, "YES") field(VAL, "3") field(FLNK, "MCOR:AS01:107:IMAX_ADC") } record(calc, "MCOR:AS01:107:IMAX_ADC") { field(DESC, "Chnl 6 Full Scale Input") field(CALC, "(A=1)||(A=6)?A*2:A") field(INPA, "MCOR:AS01:107:TYPE.RVAL") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:107:IMIN_ADC") } record(calc, "MCOR:AS01:107:IMIN_ADC") { field(DESC, "Chnl 6 Min Curr Input") field(CALC, "-A") field(INPA, "MCOR:AS01:107:IMAX_ADC") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:107:IMIN_DAC") } record(calc, "MCOR:AS01:107:IMIN_DAC") { field(DESC, "Chnl 6 Min Curr Output") field(CALC, "-A") field(INPA, "MCOR:AS01:107:TYPE.RVAL") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:107:IMAX_DAC") } record(calc, "MCOR:AS01:107:IMAX_DAC") { field(DESC, "Chnl 6 Min Curr Output") field(CALC, "A") field(INPA, "MCOR:AS01:107:TYPE.RVAL") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:107:ILIMITS_DAC") } record(seq, "MCOR:AS01:107:ILIMITS_DAC") { field(DESC, "Set full scale range") field(ASG, "Internal") field(DOL1, "0") field(DOL2, "MCOR:AS01:107:IMAX_DAC") field(DOL3, "MCOR:AS01:107:IMIN_DAC") field(DOL4, "MCOR:AS01:107:IMAX_DAC") field(DOL5, "MCOR:AS01:107:IMIN_DAC") field(LNK1, "MCOR:AS01:107:I2VSLOPE.PROC") field(LNK2, "MCOR:AS01:107:ISETPT.DRVH") field(LNK3, "MCOR:AS01:107:ISETPT.DRVL") field(LNK4, "MCOR:AS01:107:ISETPT.HOPR") field(LNK5, "MCOR:AS01:107:ISETPT.LOPR PP" ) field(FLNK, "MCOR:AS01:107:ILIMITS_ADC") } record(seq, "MCOR:AS01:107:ILIMITS_ADC") { field(DESC, "Set full scale range") field(ASG, "Internal") field(DOL1, "0") field(DOL2, "MCOR:AS01:107:IMAX_ADC") field(DOL3, "MCOR:AS01:107:IMIN_ADC") field(DOL4, "0") field(LNK1, "MCOR:AS01:107:V2ISLOPE.PROC") field(LNK2, "MCOR:AS01:107:IACT.HOPR") field(LNK3, "MCOR:AS01:107:IACT.LOPR PP") field(LNK4, "MCOR:AS01:107:DACSTEP.PROC") } # Bulk Power Supply On/Off Status # BiRa MCOR controller does have capabiilty # to read the Bulk ps on/off control and status where as # the EMCOR Controller firmware does provided on/off bulok ps control # via backplane, and the EMCOR EPICS driver provides support. However, # this bulk on/off capabilty requires a hardware interface chassis between # the bulk and the MCOR crate, which has not been designed. Therefore # a soft pvs have been provided, which gets its data from another # pv that reads the bulk on/off status from the power supply (genesys) # directly or from a plc, which is connected to the power supply # on/off signal. The on/off status of each MCOR channel is generated from # this MCOR Bulk on/off status in combination with the MCOR Fault status # for this channel. The MCOR fault status is included because an MCOR # channel can be faulted while the bulk supply is on. # # SPECIAL CASE: # There are three (3) special cases of hardware configuration including # the hard and soft x-ray chicanes in the undulator and the xleap chicane # in the ltu. For these three (2) installations circuitry has been added # to provide a separate on/off control of individual mcor channels, which # is used by the chicane string main. This hardware includes a contactor # to provide the on/off control. The contactor which is controlled and # monitored by beckhoff digial i/o modules, to open/close the contactor # and to read the state of the contactor. For these three chicanes the # main mcor channel ps has an on/off control and status, separate from # the MCOR bulk status. If a contactor exists the PV for the on/off # is defined in the field INPE. Otherwise, this field is set to the # default(1), as shown below: # # INPE=1 - The default for all but ltu and und chicanes w/contactor # INPE=CONTACTOR_STATE CP # # The STATE_CALC pv is overloaded in mgntApp/Db/und/mgnt_und1_bkhf.substitutions # for the chicanes, which only instantiates the INPE field. # # VAL: (output value) # 0 - do nothing, unknown state # 1 - ps state off # 2 - ps state on # record(calcout, "MCOR:AS01:107:STATE_CALC") { field(DESC, "PS Status") # # If the bulk ps state is invalid, do nothing. If an the fault pv is invalid # output then set mcor chan state to the bulk state. If the bulk ps is on, the # mcor chan state is on, and the mcor chan is not faulted, then output set # mcor chan state to on (1). Otherwise, set the mcor chan state to off (0). # field(CALC, "A=3?0:D=3?3:A&&E&&(B=0)?2:1") field(OUT, "MCOR:AS01:107:STATE_SEQ.SELN PP") field(INPA, "MCOR:AS01:100:PS_STATE") field(INPB, "MCOR:AS01:107:INTLKSUMY CP") field(INPC, "MCOR:AS01:100:PS_STATE.SEVR") field(INPD, "MCOR:AS01:107:INTLKSUMY.SEVR") field(INPE, "1") } record(seq, "MCOR:AS01:107:STATE_SEQ") { field(DESC, "PS State Sequence") field(SELM, "Specified") field(DOL2, "1") field(DOL3, "MCOR:AS01:100:PS_STATE") field(LNK1, "MCOR:AS01:107:STATE PP") field(LNK2, "MCOR:AS01:107:STATE PP") field(LNK3, "MCOR:AS01:107:STATE PP") } record(bo, "MCOR:AS01:107:STATE") { field(DESC, "Bulk PS Status") field(ZNAM, "OFF") field(ONAM, "ON") # # If this is a spare mcor channel, instanciate the LNK macro with a "#" field(OUT, "XCOR:AS01:221:STATE PP MSS") } record(bo, "MCOR:AS01:107:TURNEDOFF") { field(DESC, "Bulk PS Turned Off by User") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "MCOR:AS01:100:PS_TURNEDOFF NPP MS") field(OMSL, "closed_loop") # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # field(OUT, "XCOR:AS01:221:TURNEDOFF PP MS") } # Bulk Power Supply On/Off Control # SLAC EMCOR controller does not have capabiilty # to control Bulk ps on/off. # Currently, this pv is just a place holder. record(bo, "MCOR:AS01:107:STATESETPT") { field(DESC, "PS On/Off Ctrl") field(DTYP, "Raw Soft Channel") field(ZNAM, "ON") field(ONAM, "OFF") field(OUT, "") } # MCOR fault status # Since the standard BiRa controller does not have a fault status # can only be read directly off of the backplane # that can be read from VME, the occurs if there is a power dip but the bulk has not tripped of. record(calcout, "MCOR:AS01:107:FAULTSTATE_CALC") { field(DESC, "MCOR Channel Fault Status") field(PINI, "YES") field(CALC, "A") field(OUT, "MCOR:AS01:107:FAULTSTATE PP") } record(bi, "MCOR:AS01:107:FAULTSTATE") { field(DESC, "Fault Status") field(DTYP, "Soft Channel") field(ZNAM, "OK") field(ONAM, "FAULTED") field(OSV, "MAJOR") field(FLNK, "MCOR:AS01:107:INTLKSUMY_CALC") } # If severity is invaild then output a zero (0) value record(calcout, "MCOR:AS01:107:INTLKSUMY_CALC") { field(DESC, "Interlock Summary Calculation") field(CALC, "A||B?1:0") field(INPA, "MCOR:AS01:107:FAULTSTATE NPP MSS") field(INPB, "MCOR:AS01:100:PS_LATCHED_FAULTSTATE NPP NMS") field(INPC, "MCOR:AS01:107:FAULTSTATE.SEVR CPP") field(IVOA, "Set output to IVOV") field(IVOV, "0") field(OUT, "MCOR:AS01:107:INTLKSUMY PP MSS") } record(bo, "MCOR:AS01:107:INTLKSUMY") { field(DESC, "Interlock Summary") field(DTYP, "Soft Channel") field(ZNAM, "OK") field(ONAM, "FAULTED") field(DOL, "MCOR:AS01:107:INTLKSUMY_CALC NPP MSS") field(OMSL, "closed_loop") # If this is a spare mcor channel, instanciate the LNK macro with a "#" field(OUT, "XCOR:AS01:221:INTLKSUMY PP MSS") } record(bo, "MCOR:AS01:107:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "NORESET") field(ONAM, "RESET") field(OUT, "MCOR:AS01:100:RESET PP") } # MCOR Crate Information # Note: this pv is use by the pau driver # for fast feedback. record(stringout, "MCOR:AS01:107:NAME") { field(DESC, "XCOR:AS01:221:") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, "XC01S") } record(longout, "MCOR:AS01:107:CRATE") { field(DESC, "Crate 1") field(DTYP, "Soft Channel") field(HOPR, "4") field(LOPR, "1") field(PINI, "YES") field(VAL, "1") } record(longout, "MCOR:AS01:107:CHAN") { field(DESC, "Channel 6") field(DTYP, "Soft Channel") field(HOPR, "15") field(PINI, "YES") field(VAL, "6") } record(mbbo, "MCOR:AS01:107: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, "0") # # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # field(OUT, "XCOR:AS01:221:COOLING PP") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgnt.dbd") #! DBDEND record(ai, "MCOR:AS01:108:VACT") { field(DESC, "ADC Chan 7") field(SCAN, ".5 second") field(DTYP, "Hytec IP-ADC-8413") field(INP, "@ai0:7:DATA") field(PREC, "9") field(LINR, "LINEAR") field(EGUF, "10.0") field(EGUL, "-10.0") field(EGU, "V") field(HOPR, "10.0") field(LOPR, "-10.0") field(FLNK, "MCOR:AS01:108:IACT") } record(bo,"MCOR:AS01:108:CALBSETPT") { field(DESC, "Use ADC Calbration ") field(DTYP, "Hytec IP-ADC-8413") field(OUT, "@ai0:7:CAL") field(ZNAM, "Not-In-Use") field(ONAM, "In-Use") field(DOL, "1") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK,"MCOR:AS01:108:CALBSTATE") } record(bi, "MCOR:AS01:108:CALBSTATE") { field(DESC, "ADC Calibration Status") field(DTYP, "Hytec IP-ADC-8413") field(INP, "@ai0:7:CAL") field(ZNAM, "Not-In-Use") field(ONAM, "In-Use") } record(ao, "MCOR:AS01:108:ADCCHAN") { field(DESC, "ADC Chan") field(PINI, "YES") field(HOPR, "15") field(LOPR, "0") field(VAL, "7") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgnt.dbd") #! DBDEND record(ao, "MCOR:AS01:108:VSETPT") { field(DESC, "DAC ao0 Ch 7 Setpoint") field(DTYP, "ACROMAG-IP231") field(OUT, "@ao0:7:DATA") field(PREC, "9") field(EGUF, "10.0") field(EGUL, "-10.0") field(HOPR, "10.0") field(LOPR, "-10.0") field(EGU, "V") field(LINR, "LINEAR") field(DRVH, "10.0") field(DRVL, "-10.0") field(DOL, "MCOR:AS01:108:VSETPTCALC") field(OMSL, "closed_loop") } record(ai, "MCOR:AS01:108:DACCHAN") { field(DESC, "ADC ao0 Ch 7") field(PINI, "YES") field(HOPR, "15") field(LOPR, "0") field(VAL, "7") } record(stringout, "MCOR:AS01:108:DACCARDNAME") { field(DESC, "DAC ao0 Name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "ao0") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgnt.dbd") #! DBDEND record(ao, "MCOR:AS01:108:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(EGU, "A") field(PREC, "9") field(HOPR, "30") field(LOPR, "30") field(FLNK, "MCOR:AS01:108:VSETPTCALC") info(autosaveFields,"VAL") } record(calc, "MCOR:AS01:108:VSETPTCALC") { field(DESC, "Calc Voltage Setpoint") field(CALC, "(C*A)+B") field(INPA, "MCOR:AS01:108:I2VSLOPE") field(INPB, "0.0") field(INPC, "MCOR:AS01:108:ISETPT") field(EGU, "V") field(PREC, "9") field(FLNK, "MCOR:AS01:108:VSETPT") info(autosaveFields,"VAL") } record(calc, "MCOR:AS01:108:IACT") { field(DESC, "Calculate Actual Current") field(CALC, "(C*A)+B") field(INPA, "MCOR:AS01:108:V2ISLOPE") field(INPB, "0.0") field(INPC, "MCOR:AS01:108:VACT") field(EGU, "A") field(PREC, "9") # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # field(FLNK, "YCOR:AS01:222:IACT") } # Used for stepping DAC record(longout, "MCOR:AS01:108:DACSTEP") { field(DESC, "DAC steps") field(EGU, "DAC Counts") field(DRVH, "100") field(HOPR, "100") field(VAL, "3") field(FLNK, "MCOR:AS01:108:VSTEP") } record(calc, "MCOR:AS01:108:VSTEP") { field(DESC, "Step in volts") field(CALC, "B?((C-D)/B)*A:0") field(INPA, "MCOR:AS01:108:DACSTEP") field(INPB, "65535") field(INPC, "MCOR:AS01:108:VSETPT.HOPR") field(INPD, "MCOR:AS01:108:VSETPT.LOPR") field(EGU, "V") field(PREC, "9") field(FLNK, "MCOR:AS01:108:ISTEP") } record(calc, "MCOR:AS01:108:ISTEP") { field(DESC, "Step in I") field(CALC, "(C-D)==0?0:A*(B/(C-D))") field(INPA, "MCOR:AS01:108:VSTEP") field(INPB, "MCOR:AS01:108:VSTEP.C") field(INPC, "MCOR:AS01:108:IMAX_DAC") field(INPD, "MCOR:AS01:108:IMIN_DAC") field(EGU, "A") field(PREC, "9") # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # field(FLNK, "YCOR:AS01:222:TRIMSTEPMIN") } record(calc, "MCOR:AS01:108:V2ISLOPE") { field(DESC, "Slope for V to I conversion") field(CALC, "(C-D)==0?0:(A-B)/(C-D)") field(INPA, "MCOR:AS01:108:IMAX_ADC") field(INPB, "MCOR:AS01:108:IMIN_ADC") field(INPC, "MCOR:AS01:108:VSETPT.HOPR") field(INPD, "MCOR:AS01:108:VSETPT.LOPR") field(PREC, "9") } record(calcout, "MCOR:AS01:108:I2VSLOPE") { field(DESC, "Slope for I to V conversion") field(CALC, "(A-B)==0?0: (C-D)/(A-B)") field(INPA, "MCOR:AS01:108:IMAX_DAC") field(INPB, "MCOR:AS01:108:IMIN_DAC") field(INPC, "MCOR:AS01:108:VSETPT.HOPR") field(INPD, "MCOR:AS01:108:VSETPT.LOPR") field(PREC, "9") } # MCOR Power Module Type record(mbbo, "MCOR:AS01:108:TYPE") { field(DESC, "Chnl 7 Full Scale Output") field(DTYP, "Raw Soft Channel") field(NOBT, "3") field(ZRST, "Spare") field(ONST, "MCOR1") field(TWST, "MCOR2") field(THST, "MCOR6") field(FRST, "MCOR12") field(FVST, "MCOR30") field(ZRVL, "12") field(ONVL, "1") field(TWVL, "2") field(THVL, "6") field(FRVL, "12") field(FVVL, "30") field(PINI, "YES") field(VAL, "3") field(FLNK, "MCOR:AS01:108:IMAX_ADC") } record(calc, "MCOR:AS01:108:IMAX_ADC") { field(DESC, "Chnl 7 Full Scale Input") field(CALC, "(A=1)||(A=6)?A*2:A") field(INPA, "MCOR:AS01:108:TYPE.RVAL") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:108:IMIN_ADC") } record(calc, "MCOR:AS01:108:IMIN_ADC") { field(DESC, "Chnl 7 Min Curr Input") field(CALC, "-A") field(INPA, "MCOR:AS01:108:IMAX_ADC") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:108:IMIN_DAC") } record(calc, "MCOR:AS01:108:IMIN_DAC") { field(DESC, "Chnl 7 Min Curr Output") field(CALC, "-A") field(INPA, "MCOR:AS01:108:TYPE.RVAL") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:108:IMAX_DAC") } record(calc, "MCOR:AS01:108:IMAX_DAC") { field(DESC, "Chnl 7 Min Curr Output") field(CALC, "A") field(INPA, "MCOR:AS01:108:TYPE.RVAL") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:108:ILIMITS_DAC") } record(seq, "MCOR:AS01:108:ILIMITS_DAC") { field(DESC, "Set full scale range") field(ASG, "Internal") field(DOL1, "0") field(DOL2, "MCOR:AS01:108:IMAX_DAC") field(DOL3, "MCOR:AS01:108:IMIN_DAC") field(DOL4, "MCOR:AS01:108:IMAX_DAC") field(DOL5, "MCOR:AS01:108:IMIN_DAC") field(LNK1, "MCOR:AS01:108:I2VSLOPE.PROC") field(LNK2, "MCOR:AS01:108:ISETPT.DRVH") field(LNK3, "MCOR:AS01:108:ISETPT.DRVL") field(LNK4, "MCOR:AS01:108:ISETPT.HOPR") field(LNK5, "MCOR:AS01:108:ISETPT.LOPR PP" ) field(FLNK, "MCOR:AS01:108:ILIMITS_ADC") } record(seq, "MCOR:AS01:108:ILIMITS_ADC") { field(DESC, "Set full scale range") field(ASG, "Internal") field(DOL1, "0") field(DOL2, "MCOR:AS01:108:IMAX_ADC") field(DOL3, "MCOR:AS01:108:IMIN_ADC") field(DOL4, "0") field(LNK1, "MCOR:AS01:108:V2ISLOPE.PROC") field(LNK2, "MCOR:AS01:108:IACT.HOPR") field(LNK3, "MCOR:AS01:108:IACT.LOPR PP") field(LNK4, "MCOR:AS01:108:DACSTEP.PROC") } # Bulk Power Supply On/Off Status # BiRa MCOR controller does have capabiilty # to read the Bulk ps on/off control and status where as # the EMCOR Controller firmware does provided on/off bulok ps control # via backplane, and the EMCOR EPICS driver provides support. However, # this bulk on/off capabilty requires a hardware interface chassis between # the bulk and the MCOR crate, which has not been designed. Therefore # a soft pvs have been provided, which gets its data from another # pv that reads the bulk on/off status from the power supply (genesys) # directly or from a plc, which is connected to the power supply # on/off signal. The on/off status of each MCOR channel is generated from # this MCOR Bulk on/off status in combination with the MCOR Fault status # for this channel. The MCOR fault status is included because an MCOR # channel can be faulted while the bulk supply is on. # # SPECIAL CASE: # There are three (3) special cases of hardware configuration including # the hard and soft x-ray chicanes in the undulator and the xleap chicane # in the ltu. For these three (2) installations circuitry has been added # to provide a separate on/off control of individual mcor channels, which # is used by the chicane string main. This hardware includes a contactor # to provide the on/off control. The contactor which is controlled and # monitored by beckhoff digial i/o modules, to open/close the contactor # and to read the state of the contactor. For these three chicanes the # main mcor channel ps has an on/off control and status, separate from # the MCOR bulk status. If a contactor exists the PV for the on/off # is defined in the field INPE. Otherwise, this field is set to the # default(1), as shown below: # # INPE=1 - The default for all but ltu and und chicanes w/contactor # INPE=CONTACTOR_STATE CP # # The STATE_CALC pv is overloaded in mgntApp/Db/und/mgnt_und1_bkhf.substitutions # for the chicanes, which only instantiates the INPE field. # # VAL: (output value) # 0 - do nothing, unknown state # 1 - ps state off # 2 - ps state on # record(calcout, "MCOR:AS01:108:STATE_CALC") { field(DESC, "PS Status") # # If the bulk ps state is invalid, do nothing. If an the fault pv is invalid # output then set mcor chan state to the bulk state. If the bulk ps is on, the # mcor chan state is on, and the mcor chan is not faulted, then output set # mcor chan state to on (1). Otherwise, set the mcor chan state to off (0). # field(CALC, "A=3?0:D=3?3:A&&E&&(B=0)?2:1") field(OUT, "MCOR:AS01:108:STATE_SEQ.SELN PP") field(INPA, "MCOR:AS01:100:PS_STATE") field(INPB, "MCOR:AS01:108:INTLKSUMY CP") field(INPC, "MCOR:AS01:100:PS_STATE.SEVR") field(INPD, "MCOR:AS01:108:INTLKSUMY.SEVR") field(INPE, "1") } record(seq, "MCOR:AS01:108:STATE_SEQ") { field(DESC, "PS State Sequence") field(SELM, "Specified") field(DOL2, "1") field(DOL3, "MCOR:AS01:100:PS_STATE") field(LNK1, "MCOR:AS01:108:STATE PP") field(LNK2, "MCOR:AS01:108:STATE PP") field(LNK3, "MCOR:AS01:108:STATE PP") } record(bo, "MCOR:AS01:108:STATE") { field(DESC, "Bulk PS Status") field(ZNAM, "OFF") field(ONAM, "ON") # # If this is a spare mcor channel, instanciate the LNK macro with a "#" field(OUT, "YCOR:AS01:222:STATE PP MSS") } record(bo, "MCOR:AS01:108:TURNEDOFF") { field(DESC, "Bulk PS Turned Off by User") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "MCOR:AS01:100:PS_TURNEDOFF NPP MS") field(OMSL, "closed_loop") # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # field(OUT, "YCOR:AS01:222:TURNEDOFF PP MS") } # Bulk Power Supply On/Off Control # SLAC EMCOR controller does not have capabiilty # to control Bulk ps on/off. # Currently, this pv is just a place holder. record(bo, "MCOR:AS01:108:STATESETPT") { field(DESC, "PS On/Off Ctrl") field(DTYP, "Raw Soft Channel") field(ZNAM, "ON") field(ONAM, "OFF") field(OUT, "") } # MCOR fault status # Since the standard BiRa controller does not have a fault status # can only be read directly off of the backplane # that can be read from VME, the occurs if there is a power dip but the bulk has not tripped of. record(calcout, "MCOR:AS01:108:FAULTSTATE_CALC") { field(DESC, "MCOR Channel Fault Status") field(PINI, "YES") field(CALC, "A") field(OUT, "MCOR:AS01:108:FAULTSTATE PP") } record(bi, "MCOR:AS01:108:FAULTSTATE") { field(DESC, "Fault Status") field(DTYP, "Soft Channel") field(ZNAM, "OK") field(ONAM, "FAULTED") field(OSV, "MAJOR") field(FLNK, "MCOR:AS01:108:INTLKSUMY_CALC") } # If severity is invaild then output a zero (0) value record(calcout, "MCOR:AS01:108:INTLKSUMY_CALC") { field(DESC, "Interlock Summary Calculation") field(CALC, "A||B?1:0") field(INPA, "MCOR:AS01:108:FAULTSTATE NPP MSS") field(INPB, "MCOR:AS01:100:PS_LATCHED_FAULTSTATE NPP NMS") field(INPC, "MCOR:AS01:108:FAULTSTATE.SEVR CPP") field(IVOA, "Set output to IVOV") field(IVOV, "0") field(OUT, "MCOR:AS01:108:INTLKSUMY PP MSS") } record(bo, "MCOR:AS01:108:INTLKSUMY") { field(DESC, "Interlock Summary") field(DTYP, "Soft Channel") field(ZNAM, "OK") field(ONAM, "FAULTED") field(DOL, "MCOR:AS01:108:INTLKSUMY_CALC NPP MSS") field(OMSL, "closed_loop") # If this is a spare mcor channel, instanciate the LNK macro with a "#" field(OUT, "YCOR:AS01:222:INTLKSUMY PP MSS") } record(bo, "MCOR:AS01:108:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "NORESET") field(ONAM, "RESET") field(OUT, "MCOR:AS01:100:RESET PP") } # MCOR Crate Information # Note: this pv is use by the pau driver # for fast feedback. record(stringout, "MCOR:AS01:108:NAME") { field(DESC, "YCOR:AS01:222:") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, "YC01S") } record(longout, "MCOR:AS01:108:CRATE") { field(DESC, "Crate 1") field(DTYP, "Soft Channel") field(HOPR, "4") field(LOPR, "1") field(PINI, "YES") field(VAL, "1") } record(longout, "MCOR:AS01:108:CHAN") { field(DESC, "Channel 7") field(DTYP, "Soft Channel") field(HOPR, "15") field(PINI, "YES") field(VAL, "7") } record(mbbo, "MCOR:AS01:108: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, "0") # # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # field(OUT, "YCOR:AS01:222:COOLING PP") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgnt.dbd") #! DBDEND record(ai, "MCOR:AS01:109:VACT") { field(DESC, "ADC Chan 8") field(SCAN, ".5 second") field(DTYP, "Hytec IP-ADC-8413") field(INP, "@ai0:8:DATA") field(PREC, "9") field(LINR, "LINEAR") field(EGUF, "10.0") field(EGUL, "-10.0") field(EGU, "V") field(HOPR, "10.0") field(LOPR, "-10.0") field(FLNK, "MCOR:AS01:109:IACT") } record(bo,"MCOR:AS01:109:CALBSETPT") { field(DESC, "Use ADC Calbration ") field(DTYP, "Hytec IP-ADC-8413") field(OUT, "@ai0:8:CAL") field(ZNAM, "Not-In-Use") field(ONAM, "In-Use") field(DOL, "1") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK,"MCOR:AS01:109:CALBSTATE") } record(bi, "MCOR:AS01:109:CALBSTATE") { field(DESC, "ADC Calibration Status") field(DTYP, "Hytec IP-ADC-8413") field(INP, "@ai0:8:CAL") field(ZNAM, "Not-In-Use") field(ONAM, "In-Use") } record(ao, "MCOR:AS01:109:ADCCHAN") { field(DESC, "ADC Chan") field(PINI, "YES") field(HOPR, "15") field(LOPR, "0") field(VAL, "8") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgnt.dbd") #! DBDEND record(ao, "MCOR:AS01:109:VSETPT") { field(DESC, "DAC ao0 Ch 8 Setpoint") field(DTYP, "ACROMAG-IP231") field(OUT, "@ao0:8:DATA") field(PREC, "9") field(EGUF, "10.0") field(EGUL, "-10.0") field(HOPR, "10.0") field(LOPR, "-10.0") field(EGU, "V") field(LINR, "LINEAR") field(DRVH, "10.0") field(DRVL, "-10.0") field(DOL, "MCOR:AS01:109:VSETPTCALC") field(OMSL, "closed_loop") } record(ai, "MCOR:AS01:109:DACCHAN") { field(DESC, "ADC ao0 Ch 8") field(PINI, "YES") field(HOPR, "15") field(LOPR, "0") field(VAL, "8") } record(stringout, "MCOR:AS01:109:DACCARDNAME") { field(DESC, "DAC ao0 Name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "ao0") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgnt.dbd") #! DBDEND record(ao, "MCOR:AS01:109:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(EGU, "A") field(PREC, "9") field(HOPR, "30") field(LOPR, "30") field(FLNK, "MCOR:AS01:109:VSETPTCALC") info(autosaveFields,"VAL") } record(calc, "MCOR:AS01:109:VSETPTCALC") { field(DESC, "Calc Voltage Setpoint") field(CALC, "(C*A)+B") field(INPA, "MCOR:AS01:109:I2VSLOPE") field(INPB, "0.0") field(INPC, "MCOR:AS01:109:ISETPT") field(EGU, "V") field(PREC, "9") field(FLNK, "MCOR:AS01:109:VSETPT") info(autosaveFields,"VAL") } record(calc, "MCOR:AS01:109:IACT") { field(DESC, "Calculate Actual Current") field(CALC, "(C*A)+B") field(INPA, "MCOR:AS01:109:V2ISLOPE") field(INPB, "0.0") field(INPC, "MCOR:AS01:109:VACT") field(EGU, "A") field(PREC, "9") # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # field(FLNK, "XCOR:AS01:341:IACT") } # Used for stepping DAC record(longout, "MCOR:AS01:109:DACSTEP") { field(DESC, "DAC steps") field(EGU, "DAC Counts") field(DRVH, "100") field(HOPR, "100") field(VAL, "3") field(FLNK, "MCOR:AS01:109:VSTEP") } record(calc, "MCOR:AS01:109:VSTEP") { field(DESC, "Step in volts") field(CALC, "B?((C-D)/B)*A:0") field(INPA, "MCOR:AS01:109:DACSTEP") field(INPB, "65535") field(INPC, "MCOR:AS01:109:VSETPT.HOPR") field(INPD, "MCOR:AS01:109:VSETPT.LOPR") field(EGU, "V") field(PREC, "9") field(FLNK, "MCOR:AS01:109:ISTEP") } record(calc, "MCOR:AS01:109:ISTEP") { field(DESC, "Step in I") field(CALC, "(C-D)==0?0:A*(B/(C-D))") field(INPA, "MCOR:AS01:109:VSTEP") field(INPB, "MCOR:AS01:109:VSTEP.C") field(INPC, "MCOR:AS01:109:IMAX_DAC") field(INPD, "MCOR:AS01:109:IMIN_DAC") field(EGU, "A") field(PREC, "9") # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # field(FLNK, "XCOR:AS01:341:TRIMSTEPMIN") } record(calc, "MCOR:AS01:109:V2ISLOPE") { field(DESC, "Slope for V to I conversion") field(CALC, "(C-D)==0?0:(A-B)/(C-D)") field(INPA, "MCOR:AS01:109:IMAX_ADC") field(INPB, "MCOR:AS01:109:IMIN_ADC") field(INPC, "MCOR:AS01:109:VSETPT.HOPR") field(INPD, "MCOR:AS01:109:VSETPT.LOPR") field(PREC, "9") } record(calcout, "MCOR:AS01:109:I2VSLOPE") { field(DESC, "Slope for I to V conversion") field(CALC, "(A-B)==0?0: (C-D)/(A-B)") field(INPA, "MCOR:AS01:109:IMAX_DAC") field(INPB, "MCOR:AS01:109:IMIN_DAC") field(INPC, "MCOR:AS01:109:VSETPT.HOPR") field(INPD, "MCOR:AS01:109:VSETPT.LOPR") field(PREC, "9") } # MCOR Power Module Type record(mbbo, "MCOR:AS01:109:TYPE") { field(DESC, "Chnl 8 Full Scale Output") field(DTYP, "Raw Soft Channel") field(NOBT, "3") field(ZRST, "Spare") field(ONST, "MCOR1") field(TWST, "MCOR2") field(THST, "MCOR6") field(FRST, "MCOR12") field(FVST, "MCOR30") field(ZRVL, "12") field(ONVL, "1") field(TWVL, "2") field(THVL, "6") field(FRVL, "12") field(FVVL, "30") field(PINI, "YES") field(VAL, "3") field(FLNK, "MCOR:AS01:109:IMAX_ADC") } record(calc, "MCOR:AS01:109:IMAX_ADC") { field(DESC, "Chnl 8 Full Scale Input") field(CALC, "(A=1)||(A=6)?A*2:A") field(INPA, "MCOR:AS01:109:TYPE.RVAL") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:109:IMIN_ADC") } record(calc, "MCOR:AS01:109:IMIN_ADC") { field(DESC, "Chnl 8 Min Curr Input") field(CALC, "-A") field(INPA, "MCOR:AS01:109:IMAX_ADC") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:109:IMIN_DAC") } record(calc, "MCOR:AS01:109:IMIN_DAC") { field(DESC, "Chnl 8 Min Curr Output") field(CALC, "-A") field(INPA, "MCOR:AS01:109:TYPE.RVAL") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:109:IMAX_DAC") } record(calc, "MCOR:AS01:109:IMAX_DAC") { field(DESC, "Chnl 8 Min Curr Output") field(CALC, "A") field(INPA, "MCOR:AS01:109:TYPE.RVAL") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:109:ILIMITS_DAC") } record(seq, "MCOR:AS01:109:ILIMITS_DAC") { field(DESC, "Set full scale range") field(ASG, "Internal") field(DOL1, "0") field(DOL2, "MCOR:AS01:109:IMAX_DAC") field(DOL3, "MCOR:AS01:109:IMIN_DAC") field(DOL4, "MCOR:AS01:109:IMAX_DAC") field(DOL5, "MCOR:AS01:109:IMIN_DAC") field(LNK1, "MCOR:AS01:109:I2VSLOPE.PROC") field(LNK2, "MCOR:AS01:109:ISETPT.DRVH") field(LNK3, "MCOR:AS01:109:ISETPT.DRVL") field(LNK4, "MCOR:AS01:109:ISETPT.HOPR") field(LNK5, "MCOR:AS01:109:ISETPT.LOPR PP" ) field(FLNK, "MCOR:AS01:109:ILIMITS_ADC") } record(seq, "MCOR:AS01:109:ILIMITS_ADC") { field(DESC, "Set full scale range") field(ASG, "Internal") field(DOL1, "0") field(DOL2, "MCOR:AS01:109:IMAX_ADC") field(DOL3, "MCOR:AS01:109:IMIN_ADC") field(DOL4, "0") field(LNK1, "MCOR:AS01:109:V2ISLOPE.PROC") field(LNK2, "MCOR:AS01:109:IACT.HOPR") field(LNK3, "MCOR:AS01:109:IACT.LOPR PP") field(LNK4, "MCOR:AS01:109:DACSTEP.PROC") } # Bulk Power Supply On/Off Status # BiRa MCOR controller does have capabiilty # to read the Bulk ps on/off control and status where as # the EMCOR Controller firmware does provided on/off bulok ps control # via backplane, and the EMCOR EPICS driver provides support. However, # this bulk on/off capabilty requires a hardware interface chassis between # the bulk and the MCOR crate, which has not been designed. Therefore # a soft pvs have been provided, which gets its data from another # pv that reads the bulk on/off status from the power supply (genesys) # directly or from a plc, which is connected to the power supply # on/off signal. The on/off status of each MCOR channel is generated from # this MCOR Bulk on/off status in combination with the MCOR Fault status # for this channel. The MCOR fault status is included because an MCOR # channel can be faulted while the bulk supply is on. # # SPECIAL CASE: # There are three (3) special cases of hardware configuration including # the hard and soft x-ray chicanes in the undulator and the xleap chicane # in the ltu. For these three (2) installations circuitry has been added # to provide a separate on/off control of individual mcor channels, which # is used by the chicane string main. This hardware includes a contactor # to provide the on/off control. The contactor which is controlled and # monitored by beckhoff digial i/o modules, to open/close the contactor # and to read the state of the contactor. For these three chicanes the # main mcor channel ps has an on/off control and status, separate from # the MCOR bulk status. If a contactor exists the PV for the on/off # is defined in the field INPE. Otherwise, this field is set to the # default(1), as shown below: # # INPE=1 - The default for all but ltu and und chicanes w/contactor # INPE=CONTACTOR_STATE CP # # The STATE_CALC pv is overloaded in mgntApp/Db/und/mgnt_und1_bkhf.substitutions # for the chicanes, which only instantiates the INPE field. # # VAL: (output value) # 0 - do nothing, unknown state # 1 - ps state off # 2 - ps state on # record(calcout, "MCOR:AS01:109:STATE_CALC") { field(DESC, "PS Status") # # If the bulk ps state is invalid, do nothing. If an the fault pv is invalid # output then set mcor chan state to the bulk state. If the bulk ps is on, the # mcor chan state is on, and the mcor chan is not faulted, then output set # mcor chan state to on (1). Otherwise, set the mcor chan state to off (0). # field(CALC, "A=3?0:D=3?3:A&&E&&(B=0)?2:1") field(OUT, "MCOR:AS01:109:STATE_SEQ.SELN PP") field(INPA, "MCOR:AS01:100:PS_STATE") field(INPB, "MCOR:AS01:109:INTLKSUMY CP") field(INPC, "MCOR:AS01:100:PS_STATE.SEVR") field(INPD, "MCOR:AS01:109:INTLKSUMY.SEVR") field(INPE, "1") } record(seq, "MCOR:AS01:109:STATE_SEQ") { field(DESC, "PS State Sequence") field(SELM, "Specified") field(DOL2, "1") field(DOL3, "MCOR:AS01:100:PS_STATE") field(LNK1, "MCOR:AS01:109:STATE PP") field(LNK2, "MCOR:AS01:109:STATE PP") field(LNK3, "MCOR:AS01:109:STATE PP") } record(bo, "MCOR:AS01:109:STATE") { field(DESC, "Bulk PS Status") field(ZNAM, "OFF") field(ONAM, "ON") # # If this is a spare mcor channel, instanciate the LNK macro with a "#" field(OUT, "XCOR:AS01:341:STATE PP MSS") } record(bo, "MCOR:AS01:109:TURNEDOFF") { field(DESC, "Bulk PS Turned Off by User") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "MCOR:AS01:100:PS_TURNEDOFF NPP MS") field(OMSL, "closed_loop") # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # field(OUT, "XCOR:AS01:341:TURNEDOFF PP MS") } # Bulk Power Supply On/Off Control # SLAC EMCOR controller does not have capabiilty # to control Bulk ps on/off. # Currently, this pv is just a place holder. record(bo, "MCOR:AS01:109:STATESETPT") { field(DESC, "PS On/Off Ctrl") field(DTYP, "Raw Soft Channel") field(ZNAM, "ON") field(ONAM, "OFF") field(OUT, "") } # MCOR fault status # Since the standard BiRa controller does not have a fault status # can only be read directly off of the backplane # that can be read from VME, the occurs if there is a power dip but the bulk has not tripped of. record(calcout, "MCOR:AS01:109:FAULTSTATE_CALC") { field(DESC, "MCOR Channel Fault Status") field(PINI, "YES") field(CALC, "A") field(OUT, "MCOR:AS01:109:FAULTSTATE PP") } record(bi, "MCOR:AS01:109:FAULTSTATE") { field(DESC, "Fault Status") field(DTYP, "Soft Channel") field(ZNAM, "OK") field(ONAM, "FAULTED") field(OSV, "MAJOR") field(FLNK, "MCOR:AS01:109:INTLKSUMY_CALC") } # If severity is invaild then output a zero (0) value record(calcout, "MCOR:AS01:109:INTLKSUMY_CALC") { field(DESC, "Interlock Summary Calculation") field(CALC, "A||B?1:0") field(INPA, "MCOR:AS01:109:FAULTSTATE NPP MSS") field(INPB, "MCOR:AS01:100:PS_LATCHED_FAULTSTATE NPP NMS") field(INPC, "MCOR:AS01:109:FAULTSTATE.SEVR CPP") field(IVOA, "Set output to IVOV") field(IVOV, "0") field(OUT, "MCOR:AS01:109:INTLKSUMY PP MSS") } record(bo, "MCOR:AS01:109:INTLKSUMY") { field(DESC, "Interlock Summary") field(DTYP, "Soft Channel") field(ZNAM, "OK") field(ONAM, "FAULTED") field(DOL, "MCOR:AS01:109:INTLKSUMY_CALC NPP MSS") field(OMSL, "closed_loop") # If this is a spare mcor channel, instanciate the LNK macro with a "#" field(OUT, "XCOR:AS01:341:INTLKSUMY PP MSS") } record(bo, "MCOR:AS01:109:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "NORESET") field(ONAM, "RESET") field(OUT, "MCOR:AS01:100:RESET PP") } # MCOR Crate Information # Note: this pv is use by the pau driver # for fast feedback. record(stringout, "MCOR:AS01:109:NAME") { field(DESC, "XCOR:AS01:341:") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, "XC03S") } record(longout, "MCOR:AS01:109:CRATE") { field(DESC, "Crate 1") field(DTYP, "Soft Channel") field(HOPR, "4") field(LOPR, "1") field(PINI, "YES") field(VAL, "1") } record(longout, "MCOR:AS01:109:CHAN") { field(DESC, "Channel 8") field(DTYP, "Soft Channel") field(HOPR, "15") field(PINI, "YES") field(VAL, "8") } record(mbbo, "MCOR:AS01:109: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, "0") # # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # field(OUT, "XCOR:AS01:341:COOLING PP") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgnt.dbd") #! DBDEND record(ai, "MCOR:AS01:110:VACT") { field(DESC, "ADC Chan 9") field(SCAN, ".5 second") field(DTYP, "Hytec IP-ADC-8413") field(INP, "@ai0:9:DATA") field(PREC, "9") field(LINR, "LINEAR") field(EGUF, "10.0") field(EGUL, "-10.0") field(EGU, "V") field(HOPR, "10.0") field(LOPR, "-10.0") field(FLNK, "MCOR:AS01:110:IACT") } record(bo,"MCOR:AS01:110:CALBSETPT") { field(DESC, "Use ADC Calbration ") field(DTYP, "Hytec IP-ADC-8413") field(OUT, "@ai0:9:CAL") field(ZNAM, "Not-In-Use") field(ONAM, "In-Use") field(DOL, "1") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK,"MCOR:AS01:110:CALBSTATE") } record(bi, "MCOR:AS01:110:CALBSTATE") { field(DESC, "ADC Calibration Status") field(DTYP, "Hytec IP-ADC-8413") field(INP, "@ai0:9:CAL") field(ZNAM, "Not-In-Use") field(ONAM, "In-Use") } record(ao, "MCOR:AS01:110:ADCCHAN") { field(DESC, "ADC Chan") field(PINI, "YES") field(HOPR, "15") field(LOPR, "0") field(VAL, "9") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgnt.dbd") #! DBDEND record(ao, "MCOR:AS01:110:VSETPT") { field(DESC, "DAC ao0 Ch 9 Setpoint") field(DTYP, "ACROMAG-IP231") field(OUT, "@ao0:9:DATA") field(PREC, "9") field(EGUF, "10.0") field(EGUL, "-10.0") field(HOPR, "10.0") field(LOPR, "-10.0") field(EGU, "V") field(LINR, "LINEAR") field(DRVH, "10.0") field(DRVL, "-10.0") field(DOL, "MCOR:AS01:110:VSETPTCALC") field(OMSL, "closed_loop") } record(ai, "MCOR:AS01:110:DACCHAN") { field(DESC, "ADC ao0 Ch 9") field(PINI, "YES") field(HOPR, "15") field(LOPR, "0") field(VAL, "9") } record(stringout, "MCOR:AS01:110:DACCARDNAME") { field(DESC, "DAC ao0 Name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "ao0") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgnt.dbd") #! DBDEND record(ao, "MCOR:AS01:110:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(EGU, "A") field(PREC, "9") field(HOPR, "30") field(LOPR, "30") field(FLNK, "MCOR:AS01:110:VSETPTCALC") info(autosaveFields,"VAL") } record(calc, "MCOR:AS01:110:VSETPTCALC") { field(DESC, "Calc Voltage Setpoint") field(CALC, "(C*A)+B") field(INPA, "MCOR:AS01:110:I2VSLOPE") field(INPB, "0.0") field(INPC, "MCOR:AS01:110:ISETPT") field(EGU, "V") field(PREC, "9") field(FLNK, "MCOR:AS01:110:VSETPT") info(autosaveFields,"VAL") } record(calc, "MCOR:AS01:110:IACT") { field(DESC, "Calculate Actual Current") field(CALC, "(C*A)+B") field(INPA, "MCOR:AS01:110:V2ISLOPE") field(INPB, "0.0") field(INPC, "MCOR:AS01:110:VACT") field(EGU, "A") field(PREC, "9") # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # field(FLNK, "YCOR:AS01:342:IACT") } # Used for stepping DAC record(longout, "MCOR:AS01:110:DACSTEP") { field(DESC, "DAC steps") field(EGU, "DAC Counts") field(DRVH, "100") field(HOPR, "100") field(VAL, "3") field(FLNK, "MCOR:AS01:110:VSTEP") } record(calc, "MCOR:AS01:110:VSTEP") { field(DESC, "Step in volts") field(CALC, "B?((C-D)/B)*A:0") field(INPA, "MCOR:AS01:110:DACSTEP") field(INPB, "65535") field(INPC, "MCOR:AS01:110:VSETPT.HOPR") field(INPD, "MCOR:AS01:110:VSETPT.LOPR") field(EGU, "V") field(PREC, "9") field(FLNK, "MCOR:AS01:110:ISTEP") } record(calc, "MCOR:AS01:110:ISTEP") { field(DESC, "Step in I") field(CALC, "(C-D)==0?0:A*(B/(C-D))") field(INPA, "MCOR:AS01:110:VSTEP") field(INPB, "MCOR:AS01:110:VSTEP.C") field(INPC, "MCOR:AS01:110:IMAX_DAC") field(INPD, "MCOR:AS01:110:IMIN_DAC") field(EGU, "A") field(PREC, "9") # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # field(FLNK, "YCOR:AS01:342:TRIMSTEPMIN") } record(calc, "MCOR:AS01:110:V2ISLOPE") { field(DESC, "Slope for V to I conversion") field(CALC, "(C-D)==0?0:(A-B)/(C-D)") field(INPA, "MCOR:AS01:110:IMAX_ADC") field(INPB, "MCOR:AS01:110:IMIN_ADC") field(INPC, "MCOR:AS01:110:VSETPT.HOPR") field(INPD, "MCOR:AS01:110:VSETPT.LOPR") field(PREC, "9") } record(calcout, "MCOR:AS01:110:I2VSLOPE") { field(DESC, "Slope for I to V conversion") field(CALC, "(A-B)==0?0: (C-D)/(A-B)") field(INPA, "MCOR:AS01:110:IMAX_DAC") field(INPB, "MCOR:AS01:110:IMIN_DAC") field(INPC, "MCOR:AS01:110:VSETPT.HOPR") field(INPD, "MCOR:AS01:110:VSETPT.LOPR") field(PREC, "9") } # MCOR Power Module Type record(mbbo, "MCOR:AS01:110:TYPE") { field(DESC, "Chnl 9 Full Scale Output") field(DTYP, "Raw Soft Channel") field(NOBT, "3") field(ZRST, "Spare") field(ONST, "MCOR1") field(TWST, "MCOR2") field(THST, "MCOR6") field(FRST, "MCOR12") field(FVST, "MCOR30") field(ZRVL, "12") field(ONVL, "1") field(TWVL, "2") field(THVL, "6") field(FRVL, "12") field(FVVL, "30") field(PINI, "YES") field(VAL, "3") field(FLNK, "MCOR:AS01:110:IMAX_ADC") } record(calc, "MCOR:AS01:110:IMAX_ADC") { field(DESC, "Chnl 9 Full Scale Input") field(CALC, "(A=1)||(A=6)?A*2:A") field(INPA, "MCOR:AS01:110:TYPE.RVAL") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:110:IMIN_ADC") } record(calc, "MCOR:AS01:110:IMIN_ADC") { field(DESC, "Chnl 9 Min Curr Input") field(CALC, "-A") field(INPA, "MCOR:AS01:110:IMAX_ADC") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:110:IMIN_DAC") } record(calc, "MCOR:AS01:110:IMIN_DAC") { field(DESC, "Chnl 9 Min Curr Output") field(CALC, "-A") field(INPA, "MCOR:AS01:110:TYPE.RVAL") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:110:IMAX_DAC") } record(calc, "MCOR:AS01:110:IMAX_DAC") { field(DESC, "Chnl 9 Min Curr Output") field(CALC, "A") field(INPA, "MCOR:AS01:110:TYPE.RVAL") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:110:ILIMITS_DAC") } record(seq, "MCOR:AS01:110:ILIMITS_DAC") { field(DESC, "Set full scale range") field(ASG, "Internal") field(DOL1, "0") field(DOL2, "MCOR:AS01:110:IMAX_DAC") field(DOL3, "MCOR:AS01:110:IMIN_DAC") field(DOL4, "MCOR:AS01:110:IMAX_DAC") field(DOL5, "MCOR:AS01:110:IMIN_DAC") field(LNK1, "MCOR:AS01:110:I2VSLOPE.PROC") field(LNK2, "MCOR:AS01:110:ISETPT.DRVH") field(LNK3, "MCOR:AS01:110:ISETPT.DRVL") field(LNK4, "MCOR:AS01:110:ISETPT.HOPR") field(LNK5, "MCOR:AS01:110:ISETPT.LOPR PP" ) field(FLNK, "MCOR:AS01:110:ILIMITS_ADC") } record(seq, "MCOR:AS01:110:ILIMITS_ADC") { field(DESC, "Set full scale range") field(ASG, "Internal") field(DOL1, "0") field(DOL2, "MCOR:AS01:110:IMAX_ADC") field(DOL3, "MCOR:AS01:110:IMIN_ADC") field(DOL4, "0") field(LNK1, "MCOR:AS01:110:V2ISLOPE.PROC") field(LNK2, "MCOR:AS01:110:IACT.HOPR") field(LNK3, "MCOR:AS01:110:IACT.LOPR PP") field(LNK4, "MCOR:AS01:110:DACSTEP.PROC") } # Bulk Power Supply On/Off Status # BiRa MCOR controller does have capabiilty # to read the Bulk ps on/off control and status where as # the EMCOR Controller firmware does provided on/off bulok ps control # via backplane, and the EMCOR EPICS driver provides support. However, # this bulk on/off capabilty requires a hardware interface chassis between # the bulk and the MCOR crate, which has not been designed. Therefore # a soft pvs have been provided, which gets its data from another # pv that reads the bulk on/off status from the power supply (genesys) # directly or from a plc, which is connected to the power supply # on/off signal. The on/off status of each MCOR channel is generated from # this MCOR Bulk on/off status in combination with the MCOR Fault status # for this channel. The MCOR fault status is included because an MCOR # channel can be faulted while the bulk supply is on. # # SPECIAL CASE: # There are three (3) special cases of hardware configuration including # the hard and soft x-ray chicanes in the undulator and the xleap chicane # in the ltu. For these three (2) installations circuitry has been added # to provide a separate on/off control of individual mcor channels, which # is used by the chicane string main. This hardware includes a contactor # to provide the on/off control. The contactor which is controlled and # monitored by beckhoff digial i/o modules, to open/close the contactor # and to read the state of the contactor. For these three chicanes the # main mcor channel ps has an on/off control and status, separate from # the MCOR bulk status. If a contactor exists the PV for the on/off # is defined in the field INPE. Otherwise, this field is set to the # default(1), as shown below: # # INPE=1 - The default for all but ltu and und chicanes w/contactor # INPE=CONTACTOR_STATE CP # # The STATE_CALC pv is overloaded in mgntApp/Db/und/mgnt_und1_bkhf.substitutions # for the chicanes, which only instantiates the INPE field. # # VAL: (output value) # 0 - do nothing, unknown state # 1 - ps state off # 2 - ps state on # record(calcout, "MCOR:AS01:110:STATE_CALC") { field(DESC, "PS Status") # # If the bulk ps state is invalid, do nothing. If an the fault pv is invalid # output then set mcor chan state to the bulk state. If the bulk ps is on, the # mcor chan state is on, and the mcor chan is not faulted, then output set # mcor chan state to on (1). Otherwise, set the mcor chan state to off (0). # field(CALC, "A=3?0:D=3?3:A&&E&&(B=0)?2:1") field(OUT, "MCOR:AS01:110:STATE_SEQ.SELN PP") field(INPA, "MCOR:AS01:100:PS_STATE") field(INPB, "MCOR:AS01:110:INTLKSUMY CP") field(INPC, "MCOR:AS01:100:PS_STATE.SEVR") field(INPD, "MCOR:AS01:110:INTLKSUMY.SEVR") field(INPE, "1") } record(seq, "MCOR:AS01:110:STATE_SEQ") { field(DESC, "PS State Sequence") field(SELM, "Specified") field(DOL2, "1") field(DOL3, "MCOR:AS01:100:PS_STATE") field(LNK1, "MCOR:AS01:110:STATE PP") field(LNK2, "MCOR:AS01:110:STATE PP") field(LNK3, "MCOR:AS01:110:STATE PP") } record(bo, "MCOR:AS01:110:STATE") { field(DESC, "Bulk PS Status") field(ZNAM, "OFF") field(ONAM, "ON") # # If this is a spare mcor channel, instanciate the LNK macro with a "#" field(OUT, "YCOR:AS01:342:STATE PP MSS") } record(bo, "MCOR:AS01:110:TURNEDOFF") { field(DESC, "Bulk PS Turned Off by User") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "MCOR:AS01:100:PS_TURNEDOFF NPP MS") field(OMSL, "closed_loop") # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # field(OUT, "YCOR:AS01:342:TURNEDOFF PP MS") } # Bulk Power Supply On/Off Control # SLAC EMCOR controller does not have capabiilty # to control Bulk ps on/off. # Currently, this pv is just a place holder. record(bo, "MCOR:AS01:110:STATESETPT") { field(DESC, "PS On/Off Ctrl") field(DTYP, "Raw Soft Channel") field(ZNAM, "ON") field(ONAM, "OFF") field(OUT, "") } # MCOR fault status # Since the standard BiRa controller does not have a fault status # can only be read directly off of the backplane # that can be read from VME, the occurs if there is a power dip but the bulk has not tripped of. record(calcout, "MCOR:AS01:110:FAULTSTATE_CALC") { field(DESC, "MCOR Channel Fault Status") field(PINI, "YES") field(CALC, "A") field(OUT, "MCOR:AS01:110:FAULTSTATE PP") } record(bi, "MCOR:AS01:110:FAULTSTATE") { field(DESC, "Fault Status") field(DTYP, "Soft Channel") field(ZNAM, "OK") field(ONAM, "FAULTED") field(OSV, "MAJOR") field(FLNK, "MCOR:AS01:110:INTLKSUMY_CALC") } # If severity is invaild then output a zero (0) value record(calcout, "MCOR:AS01:110:INTLKSUMY_CALC") { field(DESC, "Interlock Summary Calculation") field(CALC, "A||B?1:0") field(INPA, "MCOR:AS01:110:FAULTSTATE NPP MSS") field(INPB, "MCOR:AS01:100:PS_LATCHED_FAULTSTATE NPP NMS") field(INPC, "MCOR:AS01:110:FAULTSTATE.SEVR CPP") field(IVOA, "Set output to IVOV") field(IVOV, "0") field(OUT, "MCOR:AS01:110:INTLKSUMY PP MSS") } record(bo, "MCOR:AS01:110:INTLKSUMY") { field(DESC, "Interlock Summary") field(DTYP, "Soft Channel") field(ZNAM, "OK") field(ONAM, "FAULTED") field(DOL, "MCOR:AS01:110:INTLKSUMY_CALC NPP MSS") field(OMSL, "closed_loop") # If this is a spare mcor channel, instanciate the LNK macro with a "#" field(OUT, "YCOR:AS01:342:INTLKSUMY PP MSS") } record(bo, "MCOR:AS01:110:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "NORESET") field(ONAM, "RESET") field(OUT, "MCOR:AS01:100:RESET PP") } # MCOR Crate Information # Note: this pv is use by the pau driver # for fast feedback. record(stringout, "MCOR:AS01:110:NAME") { field(DESC, "YCOR:AS01:342:") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, "YC03S") } record(longout, "MCOR:AS01:110:CRATE") { field(DESC, "Crate 1") field(DTYP, "Soft Channel") field(HOPR, "4") field(LOPR, "1") field(PINI, "YES") field(VAL, "1") } record(longout, "MCOR:AS01:110:CHAN") { field(DESC, "Channel 9") field(DTYP, "Soft Channel") field(HOPR, "15") field(PINI, "YES") field(VAL, "9") } record(mbbo, "MCOR:AS01: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, "YES") field(VAL, "0") # # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # field(OUT, "YCOR:AS01:342:COOLING PP") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgnt.dbd") #! DBDEND record(ai, "MCOR:AS01:111:VACT") { field(DESC, "ADC Chan 10") field(SCAN, ".5 second") field(DTYP, "Hytec IP-ADC-8413") field(INP, "@ai0:10:DATA") field(PREC, "9") field(LINR, "LINEAR") field(EGUF, "10.0") field(EGUL, "-10.0") field(EGU, "V") field(HOPR, "10.0") field(LOPR, "-10.0") field(FLNK, "MCOR:AS01:111:IACT") } record(bo,"MCOR:AS01:111:CALBSETPT") { field(DESC, "Use ADC Calbration ") field(DTYP, "Hytec IP-ADC-8413") field(OUT, "@ai0:10:CAL") field(ZNAM, "Not-In-Use") field(ONAM, "In-Use") field(DOL, "1") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK,"MCOR:AS01:111:CALBSTATE") } record(bi, "MCOR:AS01:111:CALBSTATE") { field(DESC, "ADC Calibration Status") field(DTYP, "Hytec IP-ADC-8413") field(INP, "@ai0:10:CAL") field(ZNAM, "Not-In-Use") field(ONAM, "In-Use") } record(ao, "MCOR:AS01:111:ADCCHAN") { field(DESC, "ADC Chan") field(PINI, "YES") field(HOPR, "15") field(LOPR, "0") field(VAL, "10") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgnt.dbd") #! DBDEND record(ao, "MCOR:AS01:111:VSETPT") { field(DESC, "DAC ao0 Ch 10 Setpoint") field(DTYP, "ACROMAG-IP231") field(OUT, "@ao0:10:DATA") field(PREC, "9") field(EGUF, "10.0") field(EGUL, "-10.0") field(HOPR, "10.0") field(LOPR, "-10.0") field(EGU, "V") field(LINR, "LINEAR") field(DRVH, "10.0") field(DRVL, "-10.0") field(DOL, "MCOR:AS01:111:VSETPTCALC") field(OMSL, "closed_loop") } record(ai, "MCOR:AS01:111:DACCHAN") { field(DESC, "ADC ao0 Ch 10") field(PINI, "YES") field(HOPR, "15") field(LOPR, "0") field(VAL, "10") } record(stringout, "MCOR:AS01:111:DACCARDNAME") { field(DESC, "DAC ao0 Name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "ao0") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgnt.dbd") #! DBDEND record(ao, "MCOR:AS01:111:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(EGU, "A") field(PREC, "9") field(HOPR, "30") field(LOPR, "30") field(FLNK, "MCOR:AS01:111:VSETPTCALC") info(autosaveFields,"VAL") } record(calc, "MCOR:AS01:111:VSETPTCALC") { field(DESC, "Calc Voltage Setpoint") field(CALC, "(C*A)+B") field(INPA, "MCOR:AS01:111:I2VSLOPE") field(INPB, "0.0") field(INPC, "MCOR:AS01:111:ISETPT") field(EGU, "V") field(PREC, "9") field(FLNK, "MCOR:AS01:111:VSETPT") info(autosaveFields,"VAL") } record(calc, "MCOR:AS01:111:IACT") { field(DESC, "Calculate Actual Current") field(CALC, "(C*A)+B") field(INPA, "MCOR:AS01:111:V2ISLOPE") field(INPB, "0.0") field(INPC, "MCOR:AS01:111:VACT") field(EGU, "A") field(PREC, "9") # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # field(FLNK, "XCOR:AS01:321:IACT") } # Used for stepping DAC record(longout, "MCOR:AS01:111:DACSTEP") { field(DESC, "DAC steps") field(EGU, "DAC Counts") field(DRVH, "100") field(HOPR, "100") field(VAL, "3") field(FLNK, "MCOR:AS01:111:VSTEP") } record(calc, "MCOR:AS01:111:VSTEP") { field(DESC, "Step in volts") field(CALC, "B?((C-D)/B)*A:0") field(INPA, "MCOR:AS01:111:DACSTEP") field(INPB, "65535") field(INPC, "MCOR:AS01:111:VSETPT.HOPR") field(INPD, "MCOR:AS01:111:VSETPT.LOPR") field(EGU, "V") field(PREC, "9") field(FLNK, "MCOR:AS01:111:ISTEP") } record(calc, "MCOR:AS01:111:ISTEP") { field(DESC, "Step in I") field(CALC, "(C-D)==0?0:A*(B/(C-D))") field(INPA, "MCOR:AS01:111:VSTEP") field(INPB, "MCOR:AS01:111:VSTEP.C") field(INPC, "MCOR:AS01:111:IMAX_DAC") field(INPD, "MCOR:AS01:111:IMIN_DAC") field(EGU, "A") field(PREC, "9") # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # field(FLNK, "XCOR:AS01:321:TRIMSTEPMIN") } record(calc, "MCOR:AS01:111:V2ISLOPE") { field(DESC, "Slope for V to I conversion") field(CALC, "(C-D)==0?0:(A-B)/(C-D)") field(INPA, "MCOR:AS01:111:IMAX_ADC") field(INPB, "MCOR:AS01:111:IMIN_ADC") field(INPC, "MCOR:AS01:111:VSETPT.HOPR") field(INPD, "MCOR:AS01:111:VSETPT.LOPR") field(PREC, "9") } record(calcout, "MCOR:AS01:111:I2VSLOPE") { field(DESC, "Slope for I to V conversion") field(CALC, "(A-B)==0?0: (C-D)/(A-B)") field(INPA, "MCOR:AS01:111:IMAX_DAC") field(INPB, "MCOR:AS01:111:IMIN_DAC") field(INPC, "MCOR:AS01:111:VSETPT.HOPR") field(INPD, "MCOR:AS01:111:VSETPT.LOPR") field(PREC, "9") } # MCOR Power Module Type record(mbbo, "MCOR:AS01:111:TYPE") { field(DESC, "Chnl 10 Full Scale Output") field(DTYP, "Raw Soft Channel") field(NOBT, "3") field(ZRST, "Spare") field(ONST, "MCOR1") field(TWST, "MCOR2") field(THST, "MCOR6") field(FRST, "MCOR12") field(FVST, "MCOR30") field(ZRVL, "12") field(ONVL, "1") field(TWVL, "2") field(THVL, "6") field(FRVL, "12") field(FVVL, "30") field(PINI, "YES") field(VAL, "3") field(FLNK, "MCOR:AS01:111:IMAX_ADC") } record(calc, "MCOR:AS01:111:IMAX_ADC") { field(DESC, "Chnl 10 Full Scale Input") field(CALC, "(A=1)||(A=6)?A*2:A") field(INPA, "MCOR:AS01:111:TYPE.RVAL") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:111:IMIN_ADC") } record(calc, "MCOR:AS01:111:IMIN_ADC") { field(DESC, "Chnl 10 Min Curr Input") field(CALC, "-A") field(INPA, "MCOR:AS01:111:IMAX_ADC") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:111:IMIN_DAC") } record(calc, "MCOR:AS01:111:IMIN_DAC") { field(DESC, "Chnl 10 Min Curr Output") field(CALC, "-A") field(INPA, "MCOR:AS01:111:TYPE.RVAL") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:111:IMAX_DAC") } record(calc, "MCOR:AS01:111:IMAX_DAC") { field(DESC, "Chnl 10 Min Curr Output") field(CALC, "A") field(INPA, "MCOR:AS01:111:TYPE.RVAL") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:111:ILIMITS_DAC") } record(seq, "MCOR:AS01:111:ILIMITS_DAC") { field(DESC, "Set full scale range") field(ASG, "Internal") field(DOL1, "0") field(DOL2, "MCOR:AS01:111:IMAX_DAC") field(DOL3, "MCOR:AS01:111:IMIN_DAC") field(DOL4, "MCOR:AS01:111:IMAX_DAC") field(DOL5, "MCOR:AS01:111:IMIN_DAC") field(LNK1, "MCOR:AS01:111:I2VSLOPE.PROC") field(LNK2, "MCOR:AS01:111:ISETPT.DRVH") field(LNK3, "MCOR:AS01:111:ISETPT.DRVL") field(LNK4, "MCOR:AS01:111:ISETPT.HOPR") field(LNK5, "MCOR:AS01:111:ISETPT.LOPR PP" ) field(FLNK, "MCOR:AS01:111:ILIMITS_ADC") } record(seq, "MCOR:AS01:111:ILIMITS_ADC") { field(DESC, "Set full scale range") field(ASG, "Internal") field(DOL1, "0") field(DOL2, "MCOR:AS01:111:IMAX_ADC") field(DOL3, "MCOR:AS01:111:IMIN_ADC") field(DOL4, "0") field(LNK1, "MCOR:AS01:111:V2ISLOPE.PROC") field(LNK2, "MCOR:AS01:111:IACT.HOPR") field(LNK3, "MCOR:AS01:111:IACT.LOPR PP") field(LNK4, "MCOR:AS01:111:DACSTEP.PROC") } # Bulk Power Supply On/Off Status # BiRa MCOR controller does have capabiilty # to read the Bulk ps on/off control and status where as # the EMCOR Controller firmware does provided on/off bulok ps control # via backplane, and the EMCOR EPICS driver provides support. However, # this bulk on/off capabilty requires a hardware interface chassis between # the bulk and the MCOR crate, which has not been designed. Therefore # a soft pvs have been provided, which gets its data from another # pv that reads the bulk on/off status from the power supply (genesys) # directly or from a plc, which is connected to the power supply # on/off signal. The on/off status of each MCOR channel is generated from # this MCOR Bulk on/off status in combination with the MCOR Fault status # for this channel. The MCOR fault status is included because an MCOR # channel can be faulted while the bulk supply is on. # # SPECIAL CASE: # There are three (3) special cases of hardware configuration including # the hard and soft x-ray chicanes in the undulator and the xleap chicane # in the ltu. For these three (2) installations circuitry has been added # to provide a separate on/off control of individual mcor channels, which # is used by the chicane string main. This hardware includes a contactor # to provide the on/off control. The contactor which is controlled and # monitored by beckhoff digial i/o modules, to open/close the contactor # and to read the state of the contactor. For these three chicanes the # main mcor channel ps has an on/off control and status, separate from # the MCOR bulk status. If a contactor exists the PV for the on/off # is defined in the field INPE. Otherwise, this field is set to the # default(1), as shown below: # # INPE=1 - The default for all but ltu and und chicanes w/contactor # INPE=CONTACTOR_STATE CP # # The STATE_CALC pv is overloaded in mgntApp/Db/und/mgnt_und1_bkhf.substitutions # for the chicanes, which only instantiates the INPE field. # # VAL: (output value) # 0 - do nothing, unknown state # 1 - ps state off # 2 - ps state on # record(calcout, "MCOR:AS01:111:STATE_CALC") { field(DESC, "PS Status") # # If the bulk ps state is invalid, do nothing. If an the fault pv is invalid # output then set mcor chan state to the bulk state. If the bulk ps is on, the # mcor chan state is on, and the mcor chan is not faulted, then output set # mcor chan state to on (1). Otherwise, set the mcor chan state to off (0). # field(CALC, "A=3?0:D=3?3:A&&E&&(B=0)?2:1") field(OUT, "MCOR:AS01:111:STATE_SEQ.SELN PP") field(INPA, "MCOR:AS01:100:PS_STATE") field(INPB, "MCOR:AS01:111:INTLKSUMY CP") field(INPC, "MCOR:AS01:100:PS_STATE.SEVR") field(INPD, "MCOR:AS01:111:INTLKSUMY.SEVR") field(INPE, "1") } record(seq, "MCOR:AS01:111:STATE_SEQ") { field(DESC, "PS State Sequence") field(SELM, "Specified") field(DOL2, "1") field(DOL3, "MCOR:AS01:100:PS_STATE") field(LNK1, "MCOR:AS01:111:STATE PP") field(LNK2, "MCOR:AS01:111:STATE PP") field(LNK3, "MCOR:AS01:111:STATE PP") } record(bo, "MCOR:AS01:111:STATE") { field(DESC, "Bulk PS Status") field(ZNAM, "OFF") field(ONAM, "ON") # # If this is a spare mcor channel, instanciate the LNK macro with a "#" field(OUT, "XCOR:AS01:321:STATE PP MSS") } record(bo, "MCOR:AS01:111:TURNEDOFF") { field(DESC, "Bulk PS Turned Off by User") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "MCOR:AS01:100:PS_TURNEDOFF NPP MS") field(OMSL, "closed_loop") # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # field(OUT, "XCOR:AS01:321:TURNEDOFF PP MS") } # Bulk Power Supply On/Off Control # SLAC EMCOR controller does not have capabiilty # to control Bulk ps on/off. # Currently, this pv is just a place holder. record(bo, "MCOR:AS01:111:STATESETPT") { field(DESC, "PS On/Off Ctrl") field(DTYP, "Raw Soft Channel") field(ZNAM, "ON") field(ONAM, "OFF") field(OUT, "") } # MCOR fault status # Since the standard BiRa controller does not have a fault status # can only be read directly off of the backplane # that can be read from VME, the occurs if there is a power dip but the bulk has not tripped of. record(calcout, "MCOR:AS01:111:FAULTSTATE_CALC") { field(DESC, "MCOR Channel Fault Status") field(PINI, "YES") field(CALC, "A") field(OUT, "MCOR:AS01:111:FAULTSTATE PP") } record(bi, "MCOR:AS01:111:FAULTSTATE") { field(DESC, "Fault Status") field(DTYP, "Soft Channel") field(ZNAM, "OK") field(ONAM, "FAULTED") field(OSV, "MAJOR") field(FLNK, "MCOR:AS01:111:INTLKSUMY_CALC") } # If severity is invaild then output a zero (0) value record(calcout, "MCOR:AS01:111:INTLKSUMY_CALC") { field(DESC, "Interlock Summary Calculation") field(CALC, "A||B?1:0") field(INPA, "MCOR:AS01:111:FAULTSTATE NPP MSS") field(INPB, "MCOR:AS01:100:PS_LATCHED_FAULTSTATE NPP NMS") field(INPC, "MCOR:AS01:111:FAULTSTATE.SEVR CPP") field(IVOA, "Set output to IVOV") field(IVOV, "0") field(OUT, "MCOR:AS01:111:INTLKSUMY PP MSS") } record(bo, "MCOR:AS01:111:INTLKSUMY") { field(DESC, "Interlock Summary") field(DTYP, "Soft Channel") field(ZNAM, "OK") field(ONAM, "FAULTED") field(DOL, "MCOR:AS01:111:INTLKSUMY_CALC NPP MSS") field(OMSL, "closed_loop") # If this is a spare mcor channel, instanciate the LNK macro with a "#" field(OUT, "XCOR:AS01:321:INTLKSUMY PP MSS") } record(bo, "MCOR:AS01:111:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "NORESET") field(ONAM, "RESET") field(OUT, "MCOR:AS01:100:RESET PP") } # MCOR Crate Information # Note: this pv is use by the pau driver # for fast feedback. record(stringout, "MCOR:AS01:111:NAME") { field(DESC, "XCOR:AS01:321:") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, "XC02S") } record(longout, "MCOR:AS01:111:CRATE") { field(DESC, "Crate 1") field(DTYP, "Soft Channel") field(HOPR, "4") field(LOPR, "1") field(PINI, "YES") field(VAL, "1") } record(longout, "MCOR:AS01:111:CHAN") { field(DESC, "Channel 10") field(DTYP, "Soft Channel") field(HOPR, "15") field(PINI, "YES") field(VAL, "10") } record(mbbo, "MCOR:AS01:111: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, "0") # # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # field(OUT, "XCOR:AS01:321:COOLING PP") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgnt.dbd") #! DBDEND record(ai, "MCOR:AS01:112:VACT") { field(DESC, "ADC Chan 11") field(SCAN, ".5 second") field(DTYP, "Hytec IP-ADC-8413") field(INP, "@ai0:11:DATA") field(PREC, "9") field(LINR, "LINEAR") field(EGUF, "10.0") field(EGUL, "-10.0") field(EGU, "V") field(HOPR, "10.0") field(LOPR, "-10.0") field(FLNK, "MCOR:AS01:112:IACT") } record(bo,"MCOR:AS01:112:CALBSETPT") { field(DESC, "Use ADC Calbration ") field(DTYP, "Hytec IP-ADC-8413") field(OUT, "@ai0:11:CAL") field(ZNAM, "Not-In-Use") field(ONAM, "In-Use") field(DOL, "1") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK,"MCOR:AS01:112:CALBSTATE") } record(bi, "MCOR:AS01:112:CALBSTATE") { field(DESC, "ADC Calibration Status") field(DTYP, "Hytec IP-ADC-8413") field(INP, "@ai0:11:CAL") field(ZNAM, "Not-In-Use") field(ONAM, "In-Use") } record(ao, "MCOR:AS01:112:ADCCHAN") { field(DESC, "ADC Chan") field(PINI, "YES") field(HOPR, "15") field(LOPR, "0") field(VAL, "11") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgnt.dbd") #! DBDEND record(ao, "MCOR:AS01:112:VSETPT") { field(DESC, "DAC ao0 Ch 11 Setpoint") field(DTYP, "ACROMAG-IP231") field(OUT, "@ao0:11:DATA") field(PREC, "9") field(EGUF, "10.0") field(EGUL, "-10.0") field(HOPR, "10.0") field(LOPR, "-10.0") field(EGU, "V") field(LINR, "LINEAR") field(DRVH, "10.0") field(DRVL, "-10.0") field(DOL, "MCOR:AS01:112:VSETPTCALC") field(OMSL, "closed_loop") } record(ai, "MCOR:AS01:112:DACCHAN") { field(DESC, "ADC ao0 Ch 11") field(PINI, "YES") field(HOPR, "15") field(LOPR, "0") field(VAL, "11") } record(stringout, "MCOR:AS01:112:DACCARDNAME") { field(DESC, "DAC ao0 Name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "ao0") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgnt.dbd") #! DBDEND record(ao, "MCOR:AS01:112:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(EGU, "A") field(PREC, "9") field(HOPR, "30") field(LOPR, "30") field(FLNK, "MCOR:AS01:112:VSETPTCALC") info(autosaveFields,"VAL") } record(calc, "MCOR:AS01:112:VSETPTCALC") { field(DESC, "Calc Voltage Setpoint") field(CALC, "(C*A)+B") field(INPA, "MCOR:AS01:112:I2VSLOPE") field(INPB, "0.0") field(INPC, "MCOR:AS01:112:ISETPT") field(EGU, "V") field(PREC, "9") field(FLNK, "MCOR:AS01:112:VSETPT") info(autosaveFields,"VAL") } record(calc, "MCOR:AS01:112:IACT") { field(DESC, "Calculate Actual Current") field(CALC, "(C*A)+B") field(INPA, "MCOR:AS01:112:V2ISLOPE") field(INPB, "0.0") field(INPC, "MCOR:AS01:112:VACT") field(EGU, "A") field(PREC, "9") # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # field(FLNK, "YCOR:AS01:322:IACT") } # Used for stepping DAC record(longout, "MCOR:AS01:112:DACSTEP") { field(DESC, "DAC steps") field(EGU, "DAC Counts") field(DRVH, "100") field(HOPR, "100") field(VAL, "3") field(FLNK, "MCOR:AS01:112:VSTEP") } record(calc, "MCOR:AS01:112:VSTEP") { field(DESC, "Step in volts") field(CALC, "B?((C-D)/B)*A:0") field(INPA, "MCOR:AS01:112:DACSTEP") field(INPB, "65535") field(INPC, "MCOR:AS01:112:VSETPT.HOPR") field(INPD, "MCOR:AS01:112:VSETPT.LOPR") field(EGU, "V") field(PREC, "9") field(FLNK, "MCOR:AS01:112:ISTEP") } record(calc, "MCOR:AS01:112:ISTEP") { field(DESC, "Step in I") field(CALC, "(C-D)==0?0:A*(B/(C-D))") field(INPA, "MCOR:AS01:112:VSTEP") field(INPB, "MCOR:AS01:112:VSTEP.C") field(INPC, "MCOR:AS01:112:IMAX_DAC") field(INPD, "MCOR:AS01:112:IMIN_DAC") field(EGU, "A") field(PREC, "9") # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # field(FLNK, "YCOR:AS01:322:TRIMSTEPMIN") } record(calc, "MCOR:AS01:112:V2ISLOPE") { field(DESC, "Slope for V to I conversion") field(CALC, "(C-D)==0?0:(A-B)/(C-D)") field(INPA, "MCOR:AS01:112:IMAX_ADC") field(INPB, "MCOR:AS01:112:IMIN_ADC") field(INPC, "MCOR:AS01:112:VSETPT.HOPR") field(INPD, "MCOR:AS01:112:VSETPT.LOPR") field(PREC, "9") } record(calcout, "MCOR:AS01:112:I2VSLOPE") { field(DESC, "Slope for I to V conversion") field(CALC, "(A-B)==0?0: (C-D)/(A-B)") field(INPA, "MCOR:AS01:112:IMAX_DAC") field(INPB, "MCOR:AS01:112:IMIN_DAC") field(INPC, "MCOR:AS01:112:VSETPT.HOPR") field(INPD, "MCOR:AS01:112:VSETPT.LOPR") field(PREC, "9") } # MCOR Power Module Type record(mbbo, "MCOR:AS01:112:TYPE") { field(DESC, "Chnl 11 Full Scale Output") field(DTYP, "Raw Soft Channel") field(NOBT, "3") field(ZRST, "Spare") field(ONST, "MCOR1") field(TWST, "MCOR2") field(THST, "MCOR6") field(FRST, "MCOR12") field(FVST, "MCOR30") field(ZRVL, "12") field(ONVL, "1") field(TWVL, "2") field(THVL, "6") field(FRVL, "12") field(FVVL, "30") field(PINI, "YES") field(VAL, "3") field(FLNK, "MCOR:AS01:112:IMAX_ADC") } record(calc, "MCOR:AS01:112:IMAX_ADC") { field(DESC, "Chnl 11 Full Scale Input") field(CALC, "(A=1)||(A=6)?A*2:A") field(INPA, "MCOR:AS01:112:TYPE.RVAL") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:112:IMIN_ADC") } record(calc, "MCOR:AS01:112:IMIN_ADC") { field(DESC, "Chnl 11 Min Curr Input") field(CALC, "-A") field(INPA, "MCOR:AS01:112:IMAX_ADC") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:112:IMIN_DAC") } record(calc, "MCOR:AS01:112:IMIN_DAC") { field(DESC, "Chnl 11 Min Curr Output") field(CALC, "-A") field(INPA, "MCOR:AS01:112:TYPE.RVAL") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:112:IMAX_DAC") } record(calc, "MCOR:AS01:112:IMAX_DAC") { field(DESC, "Chnl 11 Min Curr Output") field(CALC, "A") field(INPA, "MCOR:AS01:112:TYPE.RVAL") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:112:ILIMITS_DAC") } record(seq, "MCOR:AS01:112:ILIMITS_DAC") { field(DESC, "Set full scale range") field(ASG, "Internal") field(DOL1, "0") field(DOL2, "MCOR:AS01:112:IMAX_DAC") field(DOL3, "MCOR:AS01:112:IMIN_DAC") field(DOL4, "MCOR:AS01:112:IMAX_DAC") field(DOL5, "MCOR:AS01:112:IMIN_DAC") field(LNK1, "MCOR:AS01:112:I2VSLOPE.PROC") field(LNK2, "MCOR:AS01:112:ISETPT.DRVH") field(LNK3, "MCOR:AS01:112:ISETPT.DRVL") field(LNK4, "MCOR:AS01:112:ISETPT.HOPR") field(LNK5, "MCOR:AS01:112:ISETPT.LOPR PP" ) field(FLNK, "MCOR:AS01:112:ILIMITS_ADC") } record(seq, "MCOR:AS01:112:ILIMITS_ADC") { field(DESC, "Set full scale range") field(ASG, "Internal") field(DOL1, "0") field(DOL2, "MCOR:AS01:112:IMAX_ADC") field(DOL3, "MCOR:AS01:112:IMIN_ADC") field(DOL4, "0") field(LNK1, "MCOR:AS01:112:V2ISLOPE.PROC") field(LNK2, "MCOR:AS01:112:IACT.HOPR") field(LNK3, "MCOR:AS01:112:IACT.LOPR PP") field(LNK4, "MCOR:AS01:112:DACSTEP.PROC") } # Bulk Power Supply On/Off Status # BiRa MCOR controller does have capabiilty # to read the Bulk ps on/off control and status where as # the EMCOR Controller firmware does provided on/off bulok ps control # via backplane, and the EMCOR EPICS driver provides support. However, # this bulk on/off capabilty requires a hardware interface chassis between # the bulk and the MCOR crate, which has not been designed. Therefore # a soft pvs have been provided, which gets its data from another # pv that reads the bulk on/off status from the power supply (genesys) # directly or from a plc, which is connected to the power supply # on/off signal. The on/off status of each MCOR channel is generated from # this MCOR Bulk on/off status in combination with the MCOR Fault status # for this channel. The MCOR fault status is included because an MCOR # channel can be faulted while the bulk supply is on. # # SPECIAL CASE: # There are three (3) special cases of hardware configuration including # the hard and soft x-ray chicanes in the undulator and the xleap chicane # in the ltu. For these three (2) installations circuitry has been added # to provide a separate on/off control of individual mcor channels, which # is used by the chicane string main. This hardware includes a contactor # to provide the on/off control. The contactor which is controlled and # monitored by beckhoff digial i/o modules, to open/close the contactor # and to read the state of the contactor. For these three chicanes the # main mcor channel ps has an on/off control and status, separate from # the MCOR bulk status. If a contactor exists the PV for the on/off # is defined in the field INPE. Otherwise, this field is set to the # default(1), as shown below: # # INPE=1 - The default for all but ltu and und chicanes w/contactor # INPE=CONTACTOR_STATE CP # # The STATE_CALC pv is overloaded in mgntApp/Db/und/mgnt_und1_bkhf.substitutions # for the chicanes, which only instantiates the INPE field. # # VAL: (output value) # 0 - do nothing, unknown state # 1 - ps state off # 2 - ps state on # record(calcout, "MCOR:AS01:112:STATE_CALC") { field(DESC, "PS Status") # # If the bulk ps state is invalid, do nothing. If an the fault pv is invalid # output then set mcor chan state to the bulk state. If the bulk ps is on, the # mcor chan state is on, and the mcor chan is not faulted, then output set # mcor chan state to on (1). Otherwise, set the mcor chan state to off (0). # field(CALC, "A=3?0:D=3?3:A&&E&&(B=0)?2:1") field(OUT, "MCOR:AS01:112:STATE_SEQ.SELN PP") field(INPA, "MCOR:AS01:100:PS_STATE") field(INPB, "MCOR:AS01:112:INTLKSUMY CP") field(INPC, "MCOR:AS01:100:PS_STATE.SEVR") field(INPD, "MCOR:AS01:112:INTLKSUMY.SEVR") field(INPE, "1") } record(seq, "MCOR:AS01:112:STATE_SEQ") { field(DESC, "PS State Sequence") field(SELM, "Specified") field(DOL2, "1") field(DOL3, "MCOR:AS01:100:PS_STATE") field(LNK1, "MCOR:AS01:112:STATE PP") field(LNK2, "MCOR:AS01:112:STATE PP") field(LNK3, "MCOR:AS01:112:STATE PP") } record(bo, "MCOR:AS01:112:STATE") { field(DESC, "Bulk PS Status") field(ZNAM, "OFF") field(ONAM, "ON") # # If this is a spare mcor channel, instanciate the LNK macro with a "#" field(OUT, "YCOR:AS01:322:STATE PP MSS") } record(bo, "MCOR:AS01:112:TURNEDOFF") { field(DESC, "Bulk PS Turned Off by User") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "MCOR:AS01:100:PS_TURNEDOFF NPP MS") field(OMSL, "closed_loop") # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # field(OUT, "YCOR:AS01:322:TURNEDOFF PP MS") } # Bulk Power Supply On/Off Control # SLAC EMCOR controller does not have capabiilty # to control Bulk ps on/off. # Currently, this pv is just a place holder. record(bo, "MCOR:AS01:112:STATESETPT") { field(DESC, "PS On/Off Ctrl") field(DTYP, "Raw Soft Channel") field(ZNAM, "ON") field(ONAM, "OFF") field(OUT, "") } # MCOR fault status # Since the standard BiRa controller does not have a fault status # can only be read directly off of the backplane # that can be read from VME, the occurs if there is a power dip but the bulk has not tripped of. record(calcout, "MCOR:AS01:112:FAULTSTATE_CALC") { field(DESC, "MCOR Channel Fault Status") field(PINI, "YES") field(CALC, "A") field(OUT, "MCOR:AS01:112:FAULTSTATE PP") } record(bi, "MCOR:AS01:112:FAULTSTATE") { field(DESC, "Fault Status") field(DTYP, "Soft Channel") field(ZNAM, "OK") field(ONAM, "FAULTED") field(OSV, "MAJOR") field(FLNK, "MCOR:AS01:112:INTLKSUMY_CALC") } # If severity is invaild then output a zero (0) value record(calcout, "MCOR:AS01:112:INTLKSUMY_CALC") { field(DESC, "Interlock Summary Calculation") field(CALC, "A||B?1:0") field(INPA, "MCOR:AS01:112:FAULTSTATE NPP MSS") field(INPB, "MCOR:AS01:100:PS_LATCHED_FAULTSTATE NPP NMS") field(INPC, "MCOR:AS01:112:FAULTSTATE.SEVR CPP") field(IVOA, "Set output to IVOV") field(IVOV, "0") field(OUT, "MCOR:AS01:112:INTLKSUMY PP MSS") } record(bo, "MCOR:AS01:112:INTLKSUMY") { field(DESC, "Interlock Summary") field(DTYP, "Soft Channel") field(ZNAM, "OK") field(ONAM, "FAULTED") field(DOL, "MCOR:AS01:112:INTLKSUMY_CALC NPP MSS") field(OMSL, "closed_loop") # If this is a spare mcor channel, instanciate the LNK macro with a "#" field(OUT, "YCOR:AS01:322:INTLKSUMY PP MSS") } record(bo, "MCOR:AS01:112:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "NORESET") field(ONAM, "RESET") field(OUT, "MCOR:AS01:100:RESET PP") } # MCOR Crate Information # Note: this pv is use by the pau driver # for fast feedback. record(stringout, "MCOR:AS01:112:NAME") { field(DESC, "YCOR:AS01:322:") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, "YC02S") } record(longout, "MCOR:AS01:112:CRATE") { field(DESC, "Crate 1") field(DTYP, "Soft Channel") field(HOPR, "4") field(LOPR, "1") field(PINI, "YES") field(VAL, "1") } record(longout, "MCOR:AS01:112:CHAN") { field(DESC, "Channel 11") field(DTYP, "Soft Channel") field(HOPR, "15") field(PINI, "YES") field(VAL, "11") } record(mbbo, "MCOR:AS01:112: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, "0") # # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # field(OUT, "YCOR:AS01:322:COOLING PP") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgnt.dbd") #! DBDEND record(ai, "MCOR:AS01:113:VACT") { field(DESC, "ADC Chan 12") field(SCAN, ".5 second") field(DTYP, "Hytec IP-ADC-8413") field(INP, "@ai0:12:DATA") field(PREC, "9") field(LINR, "LINEAR") field(EGUF, "10.0") field(EGUL, "-10.0") field(EGU, "V") field(HOPR, "10.0") field(LOPR, "-10.0") field(FLNK, "MCOR:AS01:113:IACT") } record(bo,"MCOR:AS01:113:CALBSETPT") { field(DESC, "Use ADC Calbration ") field(DTYP, "Hytec IP-ADC-8413") field(OUT, "@ai0:12:CAL") field(ZNAM, "Not-In-Use") field(ONAM, "In-Use") field(DOL, "1") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK,"MCOR:AS01:113:CALBSTATE") } record(bi, "MCOR:AS01:113:CALBSTATE") { field(DESC, "ADC Calibration Status") field(DTYP, "Hytec IP-ADC-8413") field(INP, "@ai0:12:CAL") field(ZNAM, "Not-In-Use") field(ONAM, "In-Use") } record(ao, "MCOR:AS01:113:ADCCHAN") { field(DESC, "ADC Chan") field(PINI, "YES") field(HOPR, "15") field(LOPR, "0") field(VAL, "12") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgnt.dbd") #! DBDEND record(ao, "MCOR:AS01:113:VSETPT") { field(DESC, "DAC ao0 Ch 12 Setpoint") field(DTYP, "ACROMAG-IP231") field(OUT, "@ao0:12:DATA") field(PREC, "9") field(EGUF, "10.0") field(EGUL, "-10.0") field(HOPR, "10.0") field(LOPR, "-10.0") field(EGU, "V") field(LINR, "LINEAR") field(DRVH, "10.0") field(DRVL, "-10.0") field(DOL, "MCOR:AS01:113:VSETPTCALC") field(OMSL, "closed_loop") } record(ai, "MCOR:AS01:113:DACCHAN") { field(DESC, "ADC ao0 Ch 12") field(PINI, "YES") field(HOPR, "15") field(LOPR, "0") field(VAL, "12") } record(stringout, "MCOR:AS01:113:DACCARDNAME") { field(DESC, "DAC ao0 Name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "ao0") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgnt.dbd") #! DBDEND record(ao, "MCOR:AS01:113:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(EGU, "A") field(PREC, "9") field(HOPR, "30") field(LOPR, "30") field(FLNK, "MCOR:AS01:113:VSETPTCALC") info(autosaveFields,"VAL") } record(calc, "MCOR:AS01:113:VSETPTCALC") { field(DESC, "Calc Voltage Setpoint") field(CALC, "(C*A)+B") field(INPA, "MCOR:AS01:113:I2VSLOPE") field(INPB, "0.0") field(INPC, "MCOR:AS01:113:ISETPT") field(EGU, "V") field(PREC, "9") field(FLNK, "MCOR:AS01:113:VSETPT") info(autosaveFields,"VAL") } record(calc, "MCOR:AS01:113:IACT") { field(DESC, "Calculate Actual Current") field(CALC, "(C*A)+B") field(INPA, "MCOR:AS01:113:V2ISLOPE") field(INPB, "0.0") field(INPC, "MCOR:AS01:113:VACT") field(EGU, "A") field(PREC, "9") # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # # field(FLNK, "IACT") } # Used for stepping DAC record(longout, "MCOR:AS01:113:DACSTEP") { field(DESC, "DAC steps") field(EGU, "DAC Counts") field(DRVH, "100") field(HOPR, "100") field(VAL, "3") field(FLNK, "MCOR:AS01:113:VSTEP") } record(calc, "MCOR:AS01:113:VSTEP") { field(DESC, "Step in volts") field(CALC, "B?((C-D)/B)*A:0") field(INPA, "MCOR:AS01:113:DACSTEP") field(INPB, "65535") field(INPC, "MCOR:AS01:113:VSETPT.HOPR") field(INPD, "MCOR:AS01:113:VSETPT.LOPR") field(EGU, "V") field(PREC, "9") field(FLNK, "MCOR:AS01:113:ISTEP") } record(calc, "MCOR:AS01:113:ISTEP") { field(DESC, "Step in I") field(CALC, "(C-D)==0?0:A*(B/(C-D))") field(INPA, "MCOR:AS01:113:VSTEP") field(INPB, "MCOR:AS01:113:VSTEP.C") field(INPC, "MCOR:AS01:113:IMAX_DAC") field(INPD, "MCOR:AS01:113:IMIN_DAC") field(EGU, "A") field(PREC, "9") # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # # field(FLNK, "TRIMSTEPMIN") } record(calc, "MCOR:AS01:113:V2ISLOPE") { field(DESC, "Slope for V to I conversion") field(CALC, "(C-D)==0?0:(A-B)/(C-D)") field(INPA, "MCOR:AS01:113:IMAX_ADC") field(INPB, "MCOR:AS01:113:IMIN_ADC") field(INPC, "MCOR:AS01:113:VSETPT.HOPR") field(INPD, "MCOR:AS01:113:VSETPT.LOPR") field(PREC, "9") } record(calcout, "MCOR:AS01:113:I2VSLOPE") { field(DESC, "Slope for I to V conversion") field(CALC, "(A-B)==0?0: (C-D)/(A-B)") field(INPA, "MCOR:AS01:113:IMAX_DAC") field(INPB, "MCOR:AS01:113:IMIN_DAC") field(INPC, "MCOR:AS01:113:VSETPT.HOPR") field(INPD, "MCOR:AS01:113:VSETPT.LOPR") field(PREC, "9") } # MCOR Power Module Type record(mbbo, "MCOR:AS01:113:TYPE") { field(DESC, "Chnl 12 Full Scale Output") field(DTYP, "Raw Soft Channel") field(NOBT, "3") field(ZRST, "Spare") field(ONST, "MCOR1") field(TWST, "MCOR2") field(THST, "MCOR6") field(FRST, "MCOR12") field(FVST, "MCOR30") field(ZRVL, "12") field(ONVL, "1") field(TWVL, "2") field(THVL, "6") field(FRVL, "12") field(FVVL, "30") field(PINI, "YES") field(VAL, "4") field(FLNK, "MCOR:AS01:113:IMAX_ADC") } record(calc, "MCOR:AS01:113:IMAX_ADC") { field(DESC, "Chnl 12 Full Scale Input") field(CALC, "(A=1)||(A=6)?A*2:A") field(INPA, "MCOR:AS01:113:TYPE.RVAL") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:113:IMIN_ADC") } record(calc, "MCOR:AS01:113:IMIN_ADC") { field(DESC, "Chnl 12 Min Curr Input") field(CALC, "-A") field(INPA, "MCOR:AS01:113:IMAX_ADC") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:113:IMIN_DAC") } record(calc, "MCOR:AS01:113:IMIN_DAC") { field(DESC, "Chnl 12 Min Curr Output") field(CALC, "-A") field(INPA, "MCOR:AS01:113:TYPE.RVAL") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:113:IMAX_DAC") } record(calc, "MCOR:AS01:113:IMAX_DAC") { field(DESC, "Chnl 12 Min Curr Output") field(CALC, "A") field(INPA, "MCOR:AS01:113:TYPE.RVAL") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:113:ILIMITS_DAC") } record(seq, "MCOR:AS01:113:ILIMITS_DAC") { field(DESC, "Set full scale range") field(ASG, "Internal") field(DOL1, "0") field(DOL2, "MCOR:AS01:113:IMAX_DAC") field(DOL3, "MCOR:AS01:113:IMIN_DAC") field(DOL4, "MCOR:AS01:113:IMAX_DAC") field(DOL5, "MCOR:AS01:113:IMIN_DAC") field(LNK1, "MCOR:AS01:113:I2VSLOPE.PROC") field(LNK2, "MCOR:AS01:113:ISETPT.DRVH") field(LNK3, "MCOR:AS01:113:ISETPT.DRVL") field(LNK4, "MCOR:AS01:113:ISETPT.HOPR") field(LNK5, "MCOR:AS01:113:ISETPT.LOPR PP" ) field(FLNK, "MCOR:AS01:113:ILIMITS_ADC") } record(seq, "MCOR:AS01:113:ILIMITS_ADC") { field(DESC, "Set full scale range") field(ASG, "Internal") field(DOL1, "0") field(DOL2, "MCOR:AS01:113:IMAX_ADC") field(DOL3, "MCOR:AS01:113:IMIN_ADC") field(DOL4, "0") field(LNK1, "MCOR:AS01:113:V2ISLOPE.PROC") field(LNK2, "MCOR:AS01:113:IACT.HOPR") field(LNK3, "MCOR:AS01:113:IACT.LOPR PP") field(LNK4, "MCOR:AS01:113:DACSTEP.PROC") } # Bulk Power Supply On/Off Status # BiRa MCOR controller does have capabiilty # to read the Bulk ps on/off control and status where as # the EMCOR Controller firmware does provided on/off bulok ps control # via backplane, and the EMCOR EPICS driver provides support. However, # this bulk on/off capabilty requires a hardware interface chassis between # the bulk and the MCOR crate, which has not been designed. Therefore # a soft pvs have been provided, which gets its data from another # pv that reads the bulk on/off status from the power supply (genesys) # directly or from a plc, which is connected to the power supply # on/off signal. The on/off status of each MCOR channel is generated from # this MCOR Bulk on/off status in combination with the MCOR Fault status # for this channel. The MCOR fault status is included because an MCOR # channel can be faulted while the bulk supply is on. # # SPECIAL CASE: # There are three (3) special cases of hardware configuration including # the hard and soft x-ray chicanes in the undulator and the xleap chicane # in the ltu. For these three (2) installations circuitry has been added # to provide a separate on/off control of individual mcor channels, which # is used by the chicane string main. This hardware includes a contactor # to provide the on/off control. The contactor which is controlled and # monitored by beckhoff digial i/o modules, to open/close the contactor # and to read the state of the contactor. For these three chicanes the # main mcor channel ps has an on/off control and status, separate from # the MCOR bulk status. If a contactor exists the PV for the on/off # is defined in the field INPE. Otherwise, this field is set to the # default(1), as shown below: # # INPE=1 - The default for all but ltu and und chicanes w/contactor # INPE=CONTACTOR_STATE CP # # The STATE_CALC pv is overloaded in mgntApp/Db/und/mgnt_und1_bkhf.substitutions # for the chicanes, which only instantiates the INPE field. # # VAL: (output value) # 0 - do nothing, unknown state # 1 - ps state off # 2 - ps state on # record(calcout, "MCOR:AS01:113:STATE_CALC") { field(DESC, "PS Status") # # If the bulk ps state is invalid, do nothing. If an the fault pv is invalid # output then set mcor chan state to the bulk state. If the bulk ps is on, the # mcor chan state is on, and the mcor chan is not faulted, then output set # mcor chan state to on (1). Otherwise, set the mcor chan state to off (0). # field(CALC, "A=3?0:D=3?3:A&&E&&(B=0)?2:1") field(OUT, "MCOR:AS01:113:STATE_SEQ.SELN PP") field(INPA, "MCOR:AS01:100:PS_STATE") field(INPB, "MCOR:AS01:113:INTLKSUMY CP") field(INPC, "MCOR:AS01:100:PS_STATE.SEVR") field(INPD, "MCOR:AS01:113:INTLKSUMY.SEVR") field(INPE, "1") } record(seq, "MCOR:AS01:113:STATE_SEQ") { field(DESC, "PS State Sequence") field(SELM, "Specified") field(DOL2, "1") field(DOL3, "MCOR:AS01:100:PS_STATE") field(LNK1, "MCOR:AS01:113:STATE PP") field(LNK2, "MCOR:AS01:113:STATE PP") field(LNK3, "MCOR:AS01:113:STATE PP") } record(bo, "MCOR:AS01:113:STATE") { field(DESC, "Bulk PS Status") field(ZNAM, "OFF") field(ONAM, "ON") # # If this is a spare mcor channel, instanciate the LNK macro with a "#" # field(OUT, "STATE PP MSS") } record(bo, "MCOR:AS01:113:TURNEDOFF") { field(DESC, "Bulk PS Turned Off by User") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "MCOR:AS01:100:PS_TURNEDOFF NPP MS") field(OMSL, "closed_loop") # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # # field(OUT, "TURNEDOFF PP MS") } # Bulk Power Supply On/Off Control # SLAC EMCOR controller does not have capabiilty # to control Bulk ps on/off. # Currently, this pv is just a place holder. record(bo, "MCOR:AS01:113:STATESETPT") { field(DESC, "PS On/Off Ctrl") field(DTYP, "Raw Soft Channel") field(ZNAM, "ON") field(ONAM, "OFF") field(OUT, "") } # MCOR fault status # Since the standard BiRa controller does not have a fault status # can only be read directly off of the backplane # that can be read from VME, the occurs if there is a power dip but the bulk has not tripped of. record(calcout, "MCOR:AS01:113:FAULTSTATE_CALC") { field(DESC, "MCOR Channel Fault Status") field(PINI, "YES") field(CALC, "A") field(OUT, "MCOR:AS01:113:FAULTSTATE PP") } record(bi, "MCOR:AS01:113:FAULTSTATE") { field(DESC, "Fault Status") field(DTYP, "Soft Channel") field(ZNAM, "OK") field(ONAM, "FAULTED") field(OSV, "MAJOR") field(FLNK, "MCOR:AS01:113:INTLKSUMY_CALC") } # If severity is invaild then output a zero (0) value record(calcout, "MCOR:AS01:113:INTLKSUMY_CALC") { field(DESC, "Interlock Summary Calculation") field(CALC, "A||B?1:0") field(INPA, "MCOR:AS01:113:FAULTSTATE NPP MSS") field(INPB, "MCOR:AS01:100:PS_LATCHED_FAULTSTATE NPP NMS") field(INPC, "MCOR:AS01:113:FAULTSTATE.SEVR CPP") field(IVOA, "Set output to IVOV") field(IVOV, "0") field(OUT, "MCOR:AS01:113:INTLKSUMY PP MSS") } record(bo, "MCOR:AS01:113:INTLKSUMY") { field(DESC, "Interlock Summary") field(DTYP, "Soft Channel") field(ZNAM, "OK") field(ONAM, "FAULTED") field(DOL, "MCOR:AS01:113:INTLKSUMY_CALC NPP MSS") field(OMSL, "closed_loop") # If this is a spare mcor channel, instanciate the LNK macro with a "#" # field(OUT, "INTLKSUMY PP MSS") } record(bo, "MCOR:AS01:113:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "NORESET") field(ONAM, "RESET") field(OUT, "MCOR:AS01:100:RESET PP") } # MCOR Crate Information # Note: this pv is use by the pau driver # for fast feedback. record(stringout, "MCOR:AS01:113:NAME") { field(DESC, "") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, "Spare") } record(longout, "MCOR:AS01:113:CRATE") { field(DESC, "Crate 1") field(DTYP, "Soft Channel") field(HOPR, "4") field(LOPR, "1") field(PINI, "YES") field(VAL, "1") } record(longout, "MCOR:AS01:113:CHAN") { field(DESC, "Channel 12") field(DTYP, "Soft Channel") field(HOPR, "15") field(PINI, "YES") field(VAL, "12") } record(mbbo, "MCOR:AS01:113: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, "0") # # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # # field(OUT, "COOLING PP") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgnt.dbd") #! DBDEND record(ai, "MCOR:AS01:114:VACT") { field(DESC, "ADC Chan 13") field(SCAN, ".5 second") field(DTYP, "Hytec IP-ADC-8413") field(INP, "@ai0:13:DATA") field(PREC, "9") field(LINR, "LINEAR") field(EGUF, "10.0") field(EGUL, "-10.0") field(EGU, "V") field(HOPR, "10.0") field(LOPR, "-10.0") field(FLNK, "MCOR:AS01:114:IACT") } record(bo,"MCOR:AS01:114:CALBSETPT") { field(DESC, "Use ADC Calbration ") field(DTYP, "Hytec IP-ADC-8413") field(OUT, "@ai0:13:CAL") field(ZNAM, "Not-In-Use") field(ONAM, "In-Use") field(DOL, "1") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK,"MCOR:AS01:114:CALBSTATE") } record(bi, "MCOR:AS01:114:CALBSTATE") { field(DESC, "ADC Calibration Status") field(DTYP, "Hytec IP-ADC-8413") field(INP, "@ai0:13:CAL") field(ZNAM, "Not-In-Use") field(ONAM, "In-Use") } record(ao, "MCOR:AS01:114:ADCCHAN") { field(DESC, "ADC Chan") field(PINI, "YES") field(HOPR, "15") field(LOPR, "0") field(VAL, "13") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgnt.dbd") #! DBDEND record(ao, "MCOR:AS01:114:VSETPT") { field(DESC, "DAC ao0 Ch 13 Setpoint") field(DTYP, "ACROMAG-IP231") field(OUT, "@ao0:13:DATA") field(PREC, "9") field(EGUF, "10.0") field(EGUL, "-10.0") field(HOPR, "10.0") field(LOPR, "-10.0") field(EGU, "V") field(LINR, "LINEAR") field(DRVH, "10.0") field(DRVL, "-10.0") field(DOL, "MCOR:AS01:114:VSETPTCALC") field(OMSL, "closed_loop") } record(ai, "MCOR:AS01:114:DACCHAN") { field(DESC, "ADC ao0 Ch 13") field(PINI, "YES") field(HOPR, "15") field(LOPR, "0") field(VAL, "13") } record(stringout, "MCOR:AS01:114:DACCARDNAME") { field(DESC, "DAC ao0 Name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "ao0") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgnt.dbd") #! DBDEND record(ao, "MCOR:AS01:114:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(EGU, "A") field(PREC, "9") field(HOPR, "30") field(LOPR, "30") field(FLNK, "MCOR:AS01:114:VSETPTCALC") info(autosaveFields,"VAL") } record(calc, "MCOR:AS01:114:VSETPTCALC") { field(DESC, "Calc Voltage Setpoint") field(CALC, "(C*A)+B") field(INPA, "MCOR:AS01:114:I2VSLOPE") field(INPB, "0.0") field(INPC, "MCOR:AS01:114:ISETPT") field(EGU, "V") field(PREC, "9") field(FLNK, "MCOR:AS01:114:VSETPT") info(autosaveFields,"VAL") } record(calc, "MCOR:AS01:114:IACT") { field(DESC, "Calculate Actual Current") field(CALC, "(C*A)+B") field(INPA, "MCOR:AS01:114:V2ISLOPE") field(INPB, "0.0") field(INPC, "MCOR:AS01:114:VACT") field(EGU, "A") field(PREC, "9") # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # # field(FLNK, "IACT") } # Used for stepping DAC record(longout, "MCOR:AS01:114:DACSTEP") { field(DESC, "DAC steps") field(EGU, "DAC Counts") field(DRVH, "100") field(HOPR, "100") field(VAL, "3") field(FLNK, "MCOR:AS01:114:VSTEP") } record(calc, "MCOR:AS01:114:VSTEP") { field(DESC, "Step in volts") field(CALC, "B?((C-D)/B)*A:0") field(INPA, "MCOR:AS01:114:DACSTEP") field(INPB, "65535") field(INPC, "MCOR:AS01:114:VSETPT.HOPR") field(INPD, "MCOR:AS01:114:VSETPT.LOPR") field(EGU, "V") field(PREC, "9") field(FLNK, "MCOR:AS01:114:ISTEP") } record(calc, "MCOR:AS01:114:ISTEP") { field(DESC, "Step in I") field(CALC, "(C-D)==0?0:A*(B/(C-D))") field(INPA, "MCOR:AS01:114:VSTEP") field(INPB, "MCOR:AS01:114:VSTEP.C") field(INPC, "MCOR:AS01:114:IMAX_DAC") field(INPD, "MCOR:AS01:114:IMIN_DAC") field(EGU, "A") field(PREC, "9") # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # # field(FLNK, "TRIMSTEPMIN") } record(calc, "MCOR:AS01:114:V2ISLOPE") { field(DESC, "Slope for V to I conversion") field(CALC, "(C-D)==0?0:(A-B)/(C-D)") field(INPA, "MCOR:AS01:114:IMAX_ADC") field(INPB, "MCOR:AS01:114:IMIN_ADC") field(INPC, "MCOR:AS01:114:VSETPT.HOPR") field(INPD, "MCOR:AS01:114:VSETPT.LOPR") field(PREC, "9") } record(calcout, "MCOR:AS01:114:I2VSLOPE") { field(DESC, "Slope for I to V conversion") field(CALC, "(A-B)==0?0: (C-D)/(A-B)") field(INPA, "MCOR:AS01:114:IMAX_DAC") field(INPB, "MCOR:AS01:114:IMIN_DAC") field(INPC, "MCOR:AS01:114:VSETPT.HOPR") field(INPD, "MCOR:AS01:114:VSETPT.LOPR") field(PREC, "9") } # MCOR Power Module Type record(mbbo, "MCOR:AS01:114:TYPE") { field(DESC, "Chnl 13 Full Scale Output") field(DTYP, "Raw Soft Channel") field(NOBT, "3") field(ZRST, "Spare") field(ONST, "MCOR1") field(TWST, "MCOR2") field(THST, "MCOR6") field(FRST, "MCOR12") field(FVST, "MCOR30") field(ZRVL, "12") field(ONVL, "1") field(TWVL, "2") field(THVL, "6") field(FRVL, "12") field(FVVL, "30") field(PINI, "YES") field(VAL, "4") field(FLNK, "MCOR:AS01:114:IMAX_ADC") } record(calc, "MCOR:AS01:114:IMAX_ADC") { field(DESC, "Chnl 13 Full Scale Input") field(CALC, "(A=1)||(A=6)?A*2:A") field(INPA, "MCOR:AS01:114:TYPE.RVAL") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:114:IMIN_ADC") } record(calc, "MCOR:AS01:114:IMIN_ADC") { field(DESC, "Chnl 13 Min Curr Input") field(CALC, "-A") field(INPA, "MCOR:AS01:114:IMAX_ADC") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:114:IMIN_DAC") } record(calc, "MCOR:AS01:114:IMIN_DAC") { field(DESC, "Chnl 13 Min Curr Output") field(CALC, "-A") field(INPA, "MCOR:AS01:114:TYPE.RVAL") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:114:IMAX_DAC") } record(calc, "MCOR:AS01:114:IMAX_DAC") { field(DESC, "Chnl 13 Min Curr Output") field(CALC, "A") field(INPA, "MCOR:AS01:114:TYPE.RVAL") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:114:ILIMITS_DAC") } record(seq, "MCOR:AS01:114:ILIMITS_DAC") { field(DESC, "Set full scale range") field(ASG, "Internal") field(DOL1, "0") field(DOL2, "MCOR:AS01:114:IMAX_DAC") field(DOL3, "MCOR:AS01:114:IMIN_DAC") field(DOL4, "MCOR:AS01:114:IMAX_DAC") field(DOL5, "MCOR:AS01:114:IMIN_DAC") field(LNK1, "MCOR:AS01:114:I2VSLOPE.PROC") field(LNK2, "MCOR:AS01:114:ISETPT.DRVH") field(LNK3, "MCOR:AS01:114:ISETPT.DRVL") field(LNK4, "MCOR:AS01:114:ISETPT.HOPR") field(LNK5, "MCOR:AS01:114:ISETPT.LOPR PP" ) field(FLNK, "MCOR:AS01:114:ILIMITS_ADC") } record(seq, "MCOR:AS01:114:ILIMITS_ADC") { field(DESC, "Set full scale range") field(ASG, "Internal") field(DOL1, "0") field(DOL2, "MCOR:AS01:114:IMAX_ADC") field(DOL3, "MCOR:AS01:114:IMIN_ADC") field(DOL4, "0") field(LNK1, "MCOR:AS01:114:V2ISLOPE.PROC") field(LNK2, "MCOR:AS01:114:IACT.HOPR") field(LNK3, "MCOR:AS01:114:IACT.LOPR PP") field(LNK4, "MCOR:AS01:114:DACSTEP.PROC") } # Bulk Power Supply On/Off Status # BiRa MCOR controller does have capabiilty # to read the Bulk ps on/off control and status where as # the EMCOR Controller firmware does provided on/off bulok ps control # via backplane, and the EMCOR EPICS driver provides support. However, # this bulk on/off capabilty requires a hardware interface chassis between # the bulk and the MCOR crate, which has not been designed. Therefore # a soft pvs have been provided, which gets its data from another # pv that reads the bulk on/off status from the power supply (genesys) # directly or from a plc, which is connected to the power supply # on/off signal. The on/off status of each MCOR channel is generated from # this MCOR Bulk on/off status in combination with the MCOR Fault status # for this channel. The MCOR fault status is included because an MCOR # channel can be faulted while the bulk supply is on. # # SPECIAL CASE: # There are three (3) special cases of hardware configuration including # the hard and soft x-ray chicanes in the undulator and the xleap chicane # in the ltu. For these three (2) installations circuitry has been added # to provide a separate on/off control of individual mcor channels, which # is used by the chicane string main. This hardware includes a contactor # to provide the on/off control. The contactor which is controlled and # monitored by beckhoff digial i/o modules, to open/close the contactor # and to read the state of the contactor. For these three chicanes the # main mcor channel ps has an on/off control and status, separate from # the MCOR bulk status. If a contactor exists the PV for the on/off # is defined in the field INPE. Otherwise, this field is set to the # default(1), as shown below: # # INPE=1 - The default for all but ltu and und chicanes w/contactor # INPE=CONTACTOR_STATE CP # # The STATE_CALC pv is overloaded in mgntApp/Db/und/mgnt_und1_bkhf.substitutions # for the chicanes, which only instantiates the INPE field. # # VAL: (output value) # 0 - do nothing, unknown state # 1 - ps state off # 2 - ps state on # record(calcout, "MCOR:AS01:114:STATE_CALC") { field(DESC, "PS Status") # # If the bulk ps state is invalid, do nothing. If an the fault pv is invalid # output then set mcor chan state to the bulk state. If the bulk ps is on, the # mcor chan state is on, and the mcor chan is not faulted, then output set # mcor chan state to on (1). Otherwise, set the mcor chan state to off (0). # field(CALC, "A=3?0:D=3?3:A&&E&&(B=0)?2:1") field(OUT, "MCOR:AS01:114:STATE_SEQ.SELN PP") field(INPA, "MCOR:AS01:100:PS_STATE") field(INPB, "MCOR:AS01:114:INTLKSUMY CP") field(INPC, "MCOR:AS01:100:PS_STATE.SEVR") field(INPD, "MCOR:AS01:114:INTLKSUMY.SEVR") field(INPE, "1") } record(seq, "MCOR:AS01:114:STATE_SEQ") { field(DESC, "PS State Sequence") field(SELM, "Specified") field(DOL2, "1") field(DOL3, "MCOR:AS01:100:PS_STATE") field(LNK1, "MCOR:AS01:114:STATE PP") field(LNK2, "MCOR:AS01:114:STATE PP") field(LNK3, "MCOR:AS01:114:STATE PP") } record(bo, "MCOR:AS01:114:STATE") { field(DESC, "Bulk PS Status") field(ZNAM, "OFF") field(ONAM, "ON") # # If this is a spare mcor channel, instanciate the LNK macro with a "#" # field(OUT, "STATE PP MSS") } record(bo, "MCOR:AS01:114:TURNEDOFF") { field(DESC, "Bulk PS Turned Off by User") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "MCOR:AS01:100:PS_TURNEDOFF NPP MS") field(OMSL, "closed_loop") # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # # field(OUT, "TURNEDOFF PP MS") } # Bulk Power Supply On/Off Control # SLAC EMCOR controller does not have capabiilty # to control Bulk ps on/off. # Currently, this pv is just a place holder. record(bo, "MCOR:AS01:114:STATESETPT") { field(DESC, "PS On/Off Ctrl") field(DTYP, "Raw Soft Channel") field(ZNAM, "ON") field(ONAM, "OFF") field(OUT, "") } # MCOR fault status # Since the standard BiRa controller does not have a fault status # can only be read directly off of the backplane # that can be read from VME, the occurs if there is a power dip but the bulk has not tripped of. record(calcout, "MCOR:AS01:114:FAULTSTATE_CALC") { field(DESC, "MCOR Channel Fault Status") field(PINI, "YES") field(CALC, "A") field(OUT, "MCOR:AS01:114:FAULTSTATE PP") } record(bi, "MCOR:AS01:114:FAULTSTATE") { field(DESC, "Fault Status") field(DTYP, "Soft Channel") field(ZNAM, "OK") field(ONAM, "FAULTED") field(OSV, "MAJOR") field(FLNK, "MCOR:AS01:114:INTLKSUMY_CALC") } # If severity is invaild then output a zero (0) value record(calcout, "MCOR:AS01:114:INTLKSUMY_CALC") { field(DESC, "Interlock Summary Calculation") field(CALC, "A||B?1:0") field(INPA, "MCOR:AS01:114:FAULTSTATE NPP MSS") field(INPB, "MCOR:AS01:100:PS_LATCHED_FAULTSTATE NPP NMS") field(INPC, "MCOR:AS01:114:FAULTSTATE.SEVR CPP") field(IVOA, "Set output to IVOV") field(IVOV, "0") field(OUT, "MCOR:AS01:114:INTLKSUMY PP MSS") } record(bo, "MCOR:AS01:114:INTLKSUMY") { field(DESC, "Interlock Summary") field(DTYP, "Soft Channel") field(ZNAM, "OK") field(ONAM, "FAULTED") field(DOL, "MCOR:AS01:114:INTLKSUMY_CALC NPP MSS") field(OMSL, "closed_loop") # If this is a spare mcor channel, instanciate the LNK macro with a "#" # field(OUT, "INTLKSUMY PP MSS") } record(bo, "MCOR:AS01:114:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "NORESET") field(ONAM, "RESET") field(OUT, "MCOR:AS01:100:RESET PP") } # MCOR Crate Information # Note: this pv is use by the pau driver # for fast feedback. record(stringout, "MCOR:AS01:114:NAME") { field(DESC, "") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, "Spare") } record(longout, "MCOR:AS01:114:CRATE") { field(DESC, "Crate 1") field(DTYP, "Soft Channel") field(HOPR, "4") field(LOPR, "1") field(PINI, "YES") field(VAL, "1") } record(longout, "MCOR:AS01:114:CHAN") { field(DESC, "Channel 13") field(DTYP, "Soft Channel") field(HOPR, "15") field(PINI, "YES") field(VAL, "13") } record(mbbo, "MCOR:AS01:114: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, "0") # # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # # field(OUT, "COOLING PP") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgnt.dbd") #! DBDEND record(ai, "MCOR:AS01:115:VACT") { field(DESC, "ADC Chan 14") field(SCAN, ".5 second") field(DTYP, "Hytec IP-ADC-8413") field(INP, "@ai0:14:DATA") field(PREC, "9") field(LINR, "LINEAR") field(EGUF, "10.0") field(EGUL, "-10.0") field(EGU, "V") field(HOPR, "10.0") field(LOPR, "-10.0") field(FLNK, "MCOR:AS01:115:IACT") } record(bo,"MCOR:AS01:115:CALBSETPT") { field(DESC, "Use ADC Calbration ") field(DTYP, "Hytec IP-ADC-8413") field(OUT, "@ai0:14:CAL") field(ZNAM, "Not-In-Use") field(ONAM, "In-Use") field(DOL, "1") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK,"MCOR:AS01:115:CALBSTATE") } record(bi, "MCOR:AS01:115:CALBSTATE") { field(DESC, "ADC Calibration Status") field(DTYP, "Hytec IP-ADC-8413") field(INP, "@ai0:14:CAL") field(ZNAM, "Not-In-Use") field(ONAM, "In-Use") } record(ao, "MCOR:AS01:115:ADCCHAN") { field(DESC, "ADC Chan") field(PINI, "YES") field(HOPR, "15") field(LOPR, "0") field(VAL, "14") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgnt.dbd") #! DBDEND record(ao, "MCOR:AS01:115:VSETPT") { field(DESC, "DAC ao0 Ch 14 Setpoint") field(DTYP, "ACROMAG-IP231") field(OUT, "@ao0:14:DATA") field(PREC, "9") field(EGUF, "10.0") field(EGUL, "-10.0") field(HOPR, "10.0") field(LOPR, "-10.0") field(EGU, "V") field(LINR, "LINEAR") field(DRVH, "10.0") field(DRVL, "-10.0") field(DOL, "MCOR:AS01:115:VSETPTCALC") field(OMSL, "closed_loop") } record(ai, "MCOR:AS01:115:DACCHAN") { field(DESC, "ADC ao0 Ch 14") field(PINI, "YES") field(HOPR, "15") field(LOPR, "0") field(VAL, "14") } record(stringout, "MCOR:AS01:115:DACCARDNAME") { field(DESC, "DAC ao0 Name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "ao0") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgnt.dbd") #! DBDEND record(ao, "MCOR:AS01:115:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(EGU, "A") field(PREC, "9") field(HOPR, "30") field(LOPR, "30") field(FLNK, "MCOR:AS01:115:VSETPTCALC") info(autosaveFields,"VAL") } record(calc, "MCOR:AS01:115:VSETPTCALC") { field(DESC, "Calc Voltage Setpoint") field(CALC, "(C*A)+B") field(INPA, "MCOR:AS01:115:I2VSLOPE") field(INPB, "0.0") field(INPC, "MCOR:AS01:115:ISETPT") field(EGU, "V") field(PREC, "9") field(FLNK, "MCOR:AS01:115:VSETPT") info(autosaveFields,"VAL") } record(calc, "MCOR:AS01:115:IACT") { field(DESC, "Calculate Actual Current") field(CALC, "(C*A)+B") field(INPA, "MCOR:AS01:115:V2ISLOPE") field(INPB, "0.0") field(INPC, "MCOR:AS01:115:VACT") field(EGU, "A") field(PREC, "9") # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # # field(FLNK, "IACT") } # Used for stepping DAC record(longout, "MCOR:AS01:115:DACSTEP") { field(DESC, "DAC steps") field(EGU, "DAC Counts") field(DRVH, "100") field(HOPR, "100") field(VAL, "3") field(FLNK, "MCOR:AS01:115:VSTEP") } record(calc, "MCOR:AS01:115:VSTEP") { field(DESC, "Step in volts") field(CALC, "B?((C-D)/B)*A:0") field(INPA, "MCOR:AS01:115:DACSTEP") field(INPB, "65535") field(INPC, "MCOR:AS01:115:VSETPT.HOPR") field(INPD, "MCOR:AS01:115:VSETPT.LOPR") field(EGU, "V") field(PREC, "9") field(FLNK, "MCOR:AS01:115:ISTEP") } record(calc, "MCOR:AS01:115:ISTEP") { field(DESC, "Step in I") field(CALC, "(C-D)==0?0:A*(B/(C-D))") field(INPA, "MCOR:AS01:115:VSTEP") field(INPB, "MCOR:AS01:115:VSTEP.C") field(INPC, "MCOR:AS01:115:IMAX_DAC") field(INPD, "MCOR:AS01:115:IMIN_DAC") field(EGU, "A") field(PREC, "9") # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # # field(FLNK, "TRIMSTEPMIN") } record(calc, "MCOR:AS01:115:V2ISLOPE") { field(DESC, "Slope for V to I conversion") field(CALC, "(C-D)==0?0:(A-B)/(C-D)") field(INPA, "MCOR:AS01:115:IMAX_ADC") field(INPB, "MCOR:AS01:115:IMIN_ADC") field(INPC, "MCOR:AS01:115:VSETPT.HOPR") field(INPD, "MCOR:AS01:115:VSETPT.LOPR") field(PREC, "9") } record(calcout, "MCOR:AS01:115:I2VSLOPE") { field(DESC, "Slope for I to V conversion") field(CALC, "(A-B)==0?0: (C-D)/(A-B)") field(INPA, "MCOR:AS01:115:IMAX_DAC") field(INPB, "MCOR:AS01:115:IMIN_DAC") field(INPC, "MCOR:AS01:115:VSETPT.HOPR") field(INPD, "MCOR:AS01:115:VSETPT.LOPR") field(PREC, "9") } # MCOR Power Module Type record(mbbo, "MCOR:AS01:115:TYPE") { field(DESC, "Chnl 14 Full Scale Output") field(DTYP, "Raw Soft Channel") field(NOBT, "3") field(ZRST, "Spare") field(ONST, "MCOR1") field(TWST, "MCOR2") field(THST, "MCOR6") field(FRST, "MCOR12") field(FVST, "MCOR30") field(ZRVL, "12") field(ONVL, "1") field(TWVL, "2") field(THVL, "6") field(FRVL, "12") field(FVVL, "30") field(PINI, "YES") field(VAL, "4") field(FLNK, "MCOR:AS01:115:IMAX_ADC") } record(calc, "MCOR:AS01:115:IMAX_ADC") { field(DESC, "Chnl 14 Full Scale Input") field(CALC, "(A=1)||(A=6)?A*2:A") field(INPA, "MCOR:AS01:115:TYPE.RVAL") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:115:IMIN_ADC") } record(calc, "MCOR:AS01:115:IMIN_ADC") { field(DESC, "Chnl 14 Min Curr Input") field(CALC, "-A") field(INPA, "MCOR:AS01:115:IMAX_ADC") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:115:IMIN_DAC") } record(calc, "MCOR:AS01:115:IMIN_DAC") { field(DESC, "Chnl 14 Min Curr Output") field(CALC, "-A") field(INPA, "MCOR:AS01:115:TYPE.RVAL") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:115:IMAX_DAC") } record(calc, "MCOR:AS01:115:IMAX_DAC") { field(DESC, "Chnl 14 Min Curr Output") field(CALC, "A") field(INPA, "MCOR:AS01:115:TYPE.RVAL") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:115:ILIMITS_DAC") } record(seq, "MCOR:AS01:115:ILIMITS_DAC") { field(DESC, "Set full scale range") field(ASG, "Internal") field(DOL1, "0") field(DOL2, "MCOR:AS01:115:IMAX_DAC") field(DOL3, "MCOR:AS01:115:IMIN_DAC") field(DOL4, "MCOR:AS01:115:IMAX_DAC") field(DOL5, "MCOR:AS01:115:IMIN_DAC") field(LNK1, "MCOR:AS01:115:I2VSLOPE.PROC") field(LNK2, "MCOR:AS01:115:ISETPT.DRVH") field(LNK3, "MCOR:AS01:115:ISETPT.DRVL") field(LNK4, "MCOR:AS01:115:ISETPT.HOPR") field(LNK5, "MCOR:AS01:115:ISETPT.LOPR PP" ) field(FLNK, "MCOR:AS01:115:ILIMITS_ADC") } record(seq, "MCOR:AS01:115:ILIMITS_ADC") { field(DESC, "Set full scale range") field(ASG, "Internal") field(DOL1, "0") field(DOL2, "MCOR:AS01:115:IMAX_ADC") field(DOL3, "MCOR:AS01:115:IMIN_ADC") field(DOL4, "0") field(LNK1, "MCOR:AS01:115:V2ISLOPE.PROC") field(LNK2, "MCOR:AS01:115:IACT.HOPR") field(LNK3, "MCOR:AS01:115:IACT.LOPR PP") field(LNK4, "MCOR:AS01:115:DACSTEP.PROC") } # Bulk Power Supply On/Off Status # BiRa MCOR controller does have capabiilty # to read the Bulk ps on/off control and status where as # the EMCOR Controller firmware does provided on/off bulok ps control # via backplane, and the EMCOR EPICS driver provides support. However, # this bulk on/off capabilty requires a hardware interface chassis between # the bulk and the MCOR crate, which has not been designed. Therefore # a soft pvs have been provided, which gets its data from another # pv that reads the bulk on/off status from the power supply (genesys) # directly or from a plc, which is connected to the power supply # on/off signal. The on/off status of each MCOR channel is generated from # this MCOR Bulk on/off status in combination with the MCOR Fault status # for this channel. The MCOR fault status is included because an MCOR # channel can be faulted while the bulk supply is on. # # SPECIAL CASE: # There are three (3) special cases of hardware configuration including # the hard and soft x-ray chicanes in the undulator and the xleap chicane # in the ltu. For these three (2) installations circuitry has been added # to provide a separate on/off control of individual mcor channels, which # is used by the chicane string main. This hardware includes a contactor # to provide the on/off control. The contactor which is controlled and # monitored by beckhoff digial i/o modules, to open/close the contactor # and to read the state of the contactor. For these three chicanes the # main mcor channel ps has an on/off control and status, separate from # the MCOR bulk status. If a contactor exists the PV for the on/off # is defined in the field INPE. Otherwise, this field is set to the # default(1), as shown below: # # INPE=1 - The default for all but ltu and und chicanes w/contactor # INPE=CONTACTOR_STATE CP # # The STATE_CALC pv is overloaded in mgntApp/Db/und/mgnt_und1_bkhf.substitutions # for the chicanes, which only instantiates the INPE field. # # VAL: (output value) # 0 - do nothing, unknown state # 1 - ps state off # 2 - ps state on # record(calcout, "MCOR:AS01:115:STATE_CALC") { field(DESC, "PS Status") # # If the bulk ps state is invalid, do nothing. If an the fault pv is invalid # output then set mcor chan state to the bulk state. If the bulk ps is on, the # mcor chan state is on, and the mcor chan is not faulted, then output set # mcor chan state to on (1). Otherwise, set the mcor chan state to off (0). # field(CALC, "A=3?0:D=3?3:A&&E&&(B=0)?2:1") field(OUT, "MCOR:AS01:115:STATE_SEQ.SELN PP") field(INPA, "MCOR:AS01:100:PS_STATE") field(INPB, "MCOR:AS01:115:INTLKSUMY CP") field(INPC, "MCOR:AS01:100:PS_STATE.SEVR") field(INPD, "MCOR:AS01:115:INTLKSUMY.SEVR") field(INPE, "1") } record(seq, "MCOR:AS01:115:STATE_SEQ") { field(DESC, "PS State Sequence") field(SELM, "Specified") field(DOL2, "1") field(DOL3, "MCOR:AS01:100:PS_STATE") field(LNK1, "MCOR:AS01:115:STATE PP") field(LNK2, "MCOR:AS01:115:STATE PP") field(LNK3, "MCOR:AS01:115:STATE PP") } record(bo, "MCOR:AS01:115:STATE") { field(DESC, "Bulk PS Status") field(ZNAM, "OFF") field(ONAM, "ON") # # If this is a spare mcor channel, instanciate the LNK macro with a "#" # field(OUT, "STATE PP MSS") } record(bo, "MCOR:AS01:115:TURNEDOFF") { field(DESC, "Bulk PS Turned Off by User") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "MCOR:AS01:100:PS_TURNEDOFF NPP MS") field(OMSL, "closed_loop") # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # # field(OUT, "TURNEDOFF PP MS") } # Bulk Power Supply On/Off Control # SLAC EMCOR controller does not have capabiilty # to control Bulk ps on/off. # Currently, this pv is just a place holder. record(bo, "MCOR:AS01:115:STATESETPT") { field(DESC, "PS On/Off Ctrl") field(DTYP, "Raw Soft Channel") field(ZNAM, "ON") field(ONAM, "OFF") field(OUT, "") } # MCOR fault status # Since the standard BiRa controller does not have a fault status # can only be read directly off of the backplane # that can be read from VME, the occurs if there is a power dip but the bulk has not tripped of. record(calcout, "MCOR:AS01:115:FAULTSTATE_CALC") { field(DESC, "MCOR Channel Fault Status") field(PINI, "YES") field(CALC, "A") field(OUT, "MCOR:AS01:115:FAULTSTATE PP") } record(bi, "MCOR:AS01:115:FAULTSTATE") { field(DESC, "Fault Status") field(DTYP, "Soft Channel") field(ZNAM, "OK") field(ONAM, "FAULTED") field(OSV, "MAJOR") field(FLNK, "MCOR:AS01:115:INTLKSUMY_CALC") } # If severity is invaild then output a zero (0) value record(calcout, "MCOR:AS01:115:INTLKSUMY_CALC") { field(DESC, "Interlock Summary Calculation") field(CALC, "A||B?1:0") field(INPA, "MCOR:AS01:115:FAULTSTATE NPP MSS") field(INPB, "MCOR:AS01:100:PS_LATCHED_FAULTSTATE NPP NMS") field(INPC, "MCOR:AS01:115:FAULTSTATE.SEVR CPP") field(IVOA, "Set output to IVOV") field(IVOV, "0") field(OUT, "MCOR:AS01:115:INTLKSUMY PP MSS") } record(bo, "MCOR:AS01:115:INTLKSUMY") { field(DESC, "Interlock Summary") field(DTYP, "Soft Channel") field(ZNAM, "OK") field(ONAM, "FAULTED") field(DOL, "MCOR:AS01:115:INTLKSUMY_CALC NPP MSS") field(OMSL, "closed_loop") # If this is a spare mcor channel, instanciate the LNK macro with a "#" # field(OUT, "INTLKSUMY PP MSS") } record(bo, "MCOR:AS01:115:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "NORESET") field(ONAM, "RESET") field(OUT, "MCOR:AS01:100:RESET PP") } # MCOR Crate Information # Note: this pv is use by the pau driver # for fast feedback. record(stringout, "MCOR:AS01:115:NAME") { field(DESC, "") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, "Spare") } record(longout, "MCOR:AS01:115:CRATE") { field(DESC, "Crate 1") field(DTYP, "Soft Channel") field(HOPR, "4") field(LOPR, "1") field(PINI, "YES") field(VAL, "1") } record(longout, "MCOR:AS01:115:CHAN") { field(DESC, "Channel 14") field(DTYP, "Soft Channel") field(HOPR, "15") field(PINI, "YES") field(VAL, "14") } record(mbbo, "MCOR:AS01:115: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, "0") # # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # # field(OUT, "COOLING PP") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgnt.dbd") #! DBDEND record(ai, "MCOR:AS01:116:VACT") { field(DESC, "ADC Chan 15") field(SCAN, ".5 second") field(DTYP, "Hytec IP-ADC-8413") field(INP, "@ai0:15:DATA") field(PREC, "9") field(LINR, "LINEAR") field(EGUF, "10.0") field(EGUL, "-10.0") field(EGU, "V") field(HOPR, "10.0") field(LOPR, "-10.0") field(FLNK, "MCOR:AS01:116:IACT") } record(bo,"MCOR:AS01:116:CALBSETPT") { field(DESC, "Use ADC Calbration ") field(DTYP, "Hytec IP-ADC-8413") field(OUT, "@ai0:15:CAL") field(ZNAM, "Not-In-Use") field(ONAM, "In-Use") field(DOL, "1") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK,"MCOR:AS01:116:CALBSTATE") } record(bi, "MCOR:AS01:116:CALBSTATE") { field(DESC, "ADC Calibration Status") field(DTYP, "Hytec IP-ADC-8413") field(INP, "@ai0:15:CAL") field(ZNAM, "Not-In-Use") field(ONAM, "In-Use") } record(ao, "MCOR:AS01:116:ADCCHAN") { field(DESC, "ADC Chan") field(PINI, "YES") field(HOPR, "15") field(LOPR, "0") field(VAL, "15") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgnt.dbd") #! DBDEND record(ao, "MCOR:AS01:116:VSETPT") { field(DESC, "DAC ao0 Ch 15 Setpoint") field(DTYP, "ACROMAG-IP231") field(OUT, "@ao0:15:DATA") field(PREC, "9") field(EGUF, "10.0") field(EGUL, "-10.0") field(HOPR, "10.0") field(LOPR, "-10.0") field(EGU, "V") field(LINR, "LINEAR") field(DRVH, "10.0") field(DRVL, "-10.0") field(DOL, "MCOR:AS01:116:VSETPTCALC") field(OMSL, "closed_loop") } record(ai, "MCOR:AS01:116:DACCHAN") { field(DESC, "ADC ao0 Ch 15") field(PINI, "YES") field(HOPR, "15") field(LOPR, "0") field(VAL, "15") } record(stringout, "MCOR:AS01:116:DACCARDNAME") { field(DESC, "DAC ao0 Name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "ao0") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgnt.dbd") #! DBDEND record(ao, "MCOR:AS01:116:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(EGU, "A") field(PREC, "9") field(HOPR, "30") field(LOPR, "30") field(FLNK, "MCOR:AS01:116:VSETPTCALC") info(autosaveFields,"VAL") } record(calc, "MCOR:AS01:116:VSETPTCALC") { field(DESC, "Calc Voltage Setpoint") field(CALC, "(C*A)+B") field(INPA, "MCOR:AS01:116:I2VSLOPE") field(INPB, "0.0") field(INPC, "MCOR:AS01:116:ISETPT") field(EGU, "V") field(PREC, "9") field(FLNK, "MCOR:AS01:116:VSETPT") info(autosaveFields,"VAL") } record(calc, "MCOR:AS01:116:IACT") { field(DESC, "Calculate Actual Current") field(CALC, "(C*A)+B") field(INPA, "MCOR:AS01:116:V2ISLOPE") field(INPB, "0.0") field(INPC, "MCOR:AS01:116:VACT") field(EGU, "A") field(PREC, "9") # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # # field(FLNK, "IACT") } # Used for stepping DAC record(longout, "MCOR:AS01:116:DACSTEP") { field(DESC, "DAC steps") field(EGU, "DAC Counts") field(DRVH, "100") field(HOPR, "100") field(VAL, "3") field(FLNK, "MCOR:AS01:116:VSTEP") } record(calc, "MCOR:AS01:116:VSTEP") { field(DESC, "Step in volts") field(CALC, "B?((C-D)/B)*A:0") field(INPA, "MCOR:AS01:116:DACSTEP") field(INPB, "65535") field(INPC, "MCOR:AS01:116:VSETPT.HOPR") field(INPD, "MCOR:AS01:116:VSETPT.LOPR") field(EGU, "V") field(PREC, "9") field(FLNK, "MCOR:AS01:116:ISTEP") } record(calc, "MCOR:AS01:116:ISTEP") { field(DESC, "Step in I") field(CALC, "(C-D)==0?0:A*(B/(C-D))") field(INPA, "MCOR:AS01:116:VSTEP") field(INPB, "MCOR:AS01:116:VSTEP.C") field(INPC, "MCOR:AS01:116:IMAX_DAC") field(INPD, "MCOR:AS01:116:IMIN_DAC") field(EGU, "A") field(PREC, "9") # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # # field(FLNK, "TRIMSTEPMIN") } record(calc, "MCOR:AS01:116:V2ISLOPE") { field(DESC, "Slope for V to I conversion") field(CALC, "(C-D)==0?0:(A-B)/(C-D)") field(INPA, "MCOR:AS01:116:IMAX_ADC") field(INPB, "MCOR:AS01:116:IMIN_ADC") field(INPC, "MCOR:AS01:116:VSETPT.HOPR") field(INPD, "MCOR:AS01:116:VSETPT.LOPR") field(PREC, "9") } record(calcout, "MCOR:AS01:116:I2VSLOPE") { field(DESC, "Slope for I to V conversion") field(CALC, "(A-B)==0?0: (C-D)/(A-B)") field(INPA, "MCOR:AS01:116:IMAX_DAC") field(INPB, "MCOR:AS01:116:IMIN_DAC") field(INPC, "MCOR:AS01:116:VSETPT.HOPR") field(INPD, "MCOR:AS01:116:VSETPT.LOPR") field(PREC, "9") } # MCOR Power Module Type record(mbbo, "MCOR:AS01:116:TYPE") { field(DESC, "Chnl 15 Full Scale Output") field(DTYP, "Raw Soft Channel") field(NOBT, "3") field(ZRST, "Spare") field(ONST, "MCOR1") field(TWST, "MCOR2") field(THST, "MCOR6") field(FRST, "MCOR12") field(FVST, "MCOR30") field(ZRVL, "12") field(ONVL, "1") field(TWVL, "2") field(THVL, "6") field(FRVL, "12") field(FVVL, "30") field(PINI, "YES") field(VAL, "4") field(FLNK, "MCOR:AS01:116:IMAX_ADC") } record(calc, "MCOR:AS01:116:IMAX_ADC") { field(DESC, "Chnl 15 Full Scale Input") field(CALC, "(A=1)||(A=6)?A*2:A") field(INPA, "MCOR:AS01:116:TYPE.RVAL") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:116:IMIN_ADC") } record(calc, "MCOR:AS01:116:IMIN_ADC") { field(DESC, "Chnl 15 Min Curr Input") field(CALC, "-A") field(INPA, "MCOR:AS01:116:IMAX_ADC") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:116:IMIN_DAC") } record(calc, "MCOR:AS01:116:IMIN_DAC") { field(DESC, "Chnl 15 Min Curr Output") field(CALC, "-A") field(INPA, "MCOR:AS01:116:TYPE.RVAL") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:116:IMAX_DAC") } record(calc, "MCOR:AS01:116:IMAX_DAC") { field(DESC, "Chnl 15 Min Curr Output") field(CALC, "A") field(INPA, "MCOR:AS01:116:TYPE.RVAL") field(EGU, "A") field(PREC, "1") field(FLNK, "MCOR:AS01:116:ILIMITS_DAC") } record(seq, "MCOR:AS01:116:ILIMITS_DAC") { field(DESC, "Set full scale range") field(ASG, "Internal") field(DOL1, "0") field(DOL2, "MCOR:AS01:116:IMAX_DAC") field(DOL3, "MCOR:AS01:116:IMIN_DAC") field(DOL4, "MCOR:AS01:116:IMAX_DAC") field(DOL5, "MCOR:AS01:116:IMIN_DAC") field(LNK1, "MCOR:AS01:116:I2VSLOPE.PROC") field(LNK2, "MCOR:AS01:116:ISETPT.DRVH") field(LNK3, "MCOR:AS01:116:ISETPT.DRVL") field(LNK4, "MCOR:AS01:116:ISETPT.HOPR") field(LNK5, "MCOR:AS01:116:ISETPT.LOPR PP" ) field(FLNK, "MCOR:AS01:116:ILIMITS_ADC") } record(seq, "MCOR:AS01:116:ILIMITS_ADC") { field(DESC, "Set full scale range") field(ASG, "Internal") field(DOL1, "0") field(DOL2, "MCOR:AS01:116:IMAX_ADC") field(DOL3, "MCOR:AS01:116:IMIN_ADC") field(DOL4, "0") field(LNK1, "MCOR:AS01:116:V2ISLOPE.PROC") field(LNK2, "MCOR:AS01:116:IACT.HOPR") field(LNK3, "MCOR:AS01:116:IACT.LOPR PP") field(LNK4, "MCOR:AS01:116:DACSTEP.PROC") } # Bulk Power Supply On/Off Status # BiRa MCOR controller does have capabiilty # to read the Bulk ps on/off control and status where as # the EMCOR Controller firmware does provided on/off bulok ps control # via backplane, and the EMCOR EPICS driver provides support. However, # this bulk on/off capabilty requires a hardware interface chassis between # the bulk and the MCOR crate, which has not been designed. Therefore # a soft pvs have been provided, which gets its data from another # pv that reads the bulk on/off status from the power supply (genesys) # directly or from a plc, which is connected to the power supply # on/off signal. The on/off status of each MCOR channel is generated from # this MCOR Bulk on/off status in combination with the MCOR Fault status # for this channel. The MCOR fault status is included because an MCOR # channel can be faulted while the bulk supply is on. # # SPECIAL CASE: # There are three (3) special cases of hardware configuration including # the hard and soft x-ray chicanes in the undulator and the xleap chicane # in the ltu. For these three (2) installations circuitry has been added # to provide a separate on/off control of individual mcor channels, which # is used by the chicane string main. This hardware includes a contactor # to provide the on/off control. The contactor which is controlled and # monitored by beckhoff digial i/o modules, to open/close the contactor # and to read the state of the contactor. For these three chicanes the # main mcor channel ps has an on/off control and status, separate from # the MCOR bulk status. If a contactor exists the PV for the on/off # is defined in the field INPE. Otherwise, this field is set to the # default(1), as shown below: # # INPE=1 - The default for all but ltu and und chicanes w/contactor # INPE=CONTACTOR_STATE CP # # The STATE_CALC pv is overloaded in mgntApp/Db/und/mgnt_und1_bkhf.substitutions # for the chicanes, which only instantiates the INPE field. # # VAL: (output value) # 0 - do nothing, unknown state # 1 - ps state off # 2 - ps state on # record(calcout, "MCOR:AS01:116:STATE_CALC") { field(DESC, "PS Status") # # If the bulk ps state is invalid, do nothing. If an the fault pv is invalid # output then set mcor chan state to the bulk state. If the bulk ps is on, the # mcor chan state is on, and the mcor chan is not faulted, then output set # mcor chan state to on (1). Otherwise, set the mcor chan state to off (0). # field(CALC, "A=3?0:D=3?3:A&&E&&(B=0)?2:1") field(OUT, "MCOR:AS01:116:STATE_SEQ.SELN PP") field(INPA, "MCOR:AS01:100:PS_STATE") field(INPB, "MCOR:AS01:116:INTLKSUMY CP") field(INPC, "MCOR:AS01:100:PS_STATE.SEVR") field(INPD, "MCOR:AS01:116:INTLKSUMY.SEVR") field(INPE, "1") } record(seq, "MCOR:AS01:116:STATE_SEQ") { field(DESC, "PS State Sequence") field(SELM, "Specified") field(DOL2, "1") field(DOL3, "MCOR:AS01:100:PS_STATE") field(LNK1, "MCOR:AS01:116:STATE PP") field(LNK2, "MCOR:AS01:116:STATE PP") field(LNK3, "MCOR:AS01:116:STATE PP") } record(bo, "MCOR:AS01:116:STATE") { field(DESC, "Bulk PS Status") field(ZNAM, "OFF") field(ONAM, "ON") # # If this is a spare mcor channel, instanciate the LNK macro with a "#" # field(OUT, "STATE PP MSS") } record(bo, "MCOR:AS01:116:TURNEDOFF") { field(DESC, "Bulk PS Turned Off by User") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "MCOR:AS01:100:PS_TURNEDOFF NPP MS") field(OMSL, "closed_loop") # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # # field(OUT, "TURNEDOFF PP MS") } # Bulk Power Supply On/Off Control # SLAC EMCOR controller does not have capabiilty # to control Bulk ps on/off. # Currently, this pv is just a place holder. record(bo, "MCOR:AS01:116:STATESETPT") { field(DESC, "PS On/Off Ctrl") field(DTYP, "Raw Soft Channel") field(ZNAM, "ON") field(ONAM, "OFF") field(OUT, "") } # MCOR fault status # Since the standard BiRa controller does not have a fault status # can only be read directly off of the backplane # that can be read from VME, the occurs if there is a power dip but the bulk has not tripped of. record(calcout, "MCOR:AS01:116:FAULTSTATE_CALC") { field(DESC, "MCOR Channel Fault Status") field(PINI, "YES") field(CALC, "A") field(OUT, "MCOR:AS01:116:FAULTSTATE PP") } record(bi, "MCOR:AS01:116:FAULTSTATE") { field(DESC, "Fault Status") field(DTYP, "Soft Channel") field(ZNAM, "OK") field(ONAM, "FAULTED") field(OSV, "MAJOR") field(FLNK, "MCOR:AS01:116:INTLKSUMY_CALC") } # If severity is invaild then output a zero (0) value record(calcout, "MCOR:AS01:116:INTLKSUMY_CALC") { field(DESC, "Interlock Summary Calculation") field(CALC, "A||B?1:0") field(INPA, "MCOR:AS01:116:FAULTSTATE NPP MSS") field(INPB, "MCOR:AS01:100:PS_LATCHED_FAULTSTATE NPP NMS") field(INPC, "MCOR:AS01:116:FAULTSTATE.SEVR CPP") field(IVOA, "Set output to IVOV") field(IVOV, "0") field(OUT, "MCOR:AS01:116:INTLKSUMY PP MSS") } record(bo, "MCOR:AS01:116:INTLKSUMY") { field(DESC, "Interlock Summary") field(DTYP, "Soft Channel") field(ZNAM, "OK") field(ONAM, "FAULTED") field(DOL, "MCOR:AS01:116:INTLKSUMY_CALC NPP MSS") field(OMSL, "closed_loop") # If this is a spare mcor channel, instanciate the LNK macro with a "#" # field(OUT, "INTLKSUMY PP MSS") } record(bo, "MCOR:AS01:116:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "NORESET") field(ONAM, "RESET") field(OUT, "MCOR:AS01:100:RESET PP") } # MCOR Crate Information # Note: this pv is use by the pau driver # for fast feedback. record(stringout, "MCOR:AS01:116:NAME") { field(DESC, "") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, "Spare") } record(longout, "MCOR:AS01:116:CRATE") { field(DESC, "Crate 1") field(DTYP, "Soft Channel") field(HOPR, "4") field(LOPR, "1") field(PINI, "YES") field(VAL, "1") } record(longout, "MCOR:AS01:116:CHAN") { field(DESC, "Channel 15") field(DTYP, "Soft Channel") field(HOPR, "15") field(PINI, "YES") field(VAL, "15") } record(mbbo, "MCOR:AS01:116: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, "0") # # If this is a spare mcor channel, # instanciate the LNK macro with a "#" # # field(OUT, "COOLING PP") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgnt.dbd") #! DBDEND record(bi, "MCOR:AS01:100:VRANGE") { field(DESC, "Module Voltage Range") field(DTYP, "Hytec IP-ADC-8413") field(INP, "@ai0:1:ACR") field(ZNAM, "+/-10V") field(ONAM, "+/-5V") field(PINI, "YES") } record(bi, "MCOR:AS01:100:MODE") { field(DESC, "Module Operating Mode") field(DTYP, "Hytec IP-ADC-8413") field(INP, "@ai0:3:ACR") field(ZNAM, "Standby") field(ONAM, "Normal") field(PINI, "YES") } record(bi, "MCOR:AS01:100:AENSTATUS") { field(DESC, "AVE Enable Status") field(DTYP, "Hytec IP-ADC-8413") field(INP, "@ai0:8:ACR") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(PINI, "YES") } record(bi, "MCOR:AS01:100:ARSSTATUS") { field(DESC, "ADC Readout Select Status") field(DTYP, "Hytec IP-ADC-8413") field(INP, "@ai0:10:ACR") field(ZNAM, "ADC Data") field(ONAM, "Averaged Data") field(PINI, "YES") } record(bi, "MCOR:AS01:100:AINISTATUS") { field(DESC, "Average Init Status") field(DTYP, "Hytec IP-ADC-8413") field(INP, "@ai0:11:ACR") field(ZNAM, "Normal") field(ONAM, "Initialize") field(PINI, "YES") } record(bi, "MCOR:AS01:100:SAMMODE") { field(DESC, "SAM Mode Status") field(SCAN, "Passive") field(DTYP, "Hytec IP-ADC-8413") field(INP, "@ai0:12:ACR") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(PINI, "YES") } record(bi, "MCOR:AS01:100:FORMAT") { field(DESC, "ADC Data Format") field(DTYP, "Hytec IP-ADC-8413") field(INP, "@ai0:4:ACR") field(ZNAM, "Two's Compliment") field(ONAM, "Offset Binary") field(PINI, "YES") } record(longin, "MCOR:AS01:100:VECTOR") { field(DESC, "Interrupt Vector") field(DTYP, "Hytec IP-ADC-8413") field(INP, "@ai0:4:IO") field(PINI, "YES") } record(mbbi, "MCOR:AS01:100:CLKRATE") { field(DESC, "Internal 15.36MHz Clock Rate") field(DTYP, "Hytec IP-ADC-8413") field(INP, "@ai0:3:IO") field(NOBT, "8") field(ZRST, "0.96 Hz") field(ONST, "1.92 Hz") field(TWST, "4.8 Hz") field(THST, "9.6 Hz") field(FRST, "19.2 Hz") field(FVST, "48 Hz") field(SXST, "96 Hz") field(SVST, "192 Hz") field(EIST, "480Hz") 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(ZRSV, "NO_ALARM") field(ONSV, "NO_ALARM") field(TWSV, "NO_ALARM") field(THSV, "NO_ALARM") field(FRSV, "NO_ALARM") field(FVSV, "NO_ALARM") field(SXSV, "NO_ALARM") field(SVSV, "NO_ALARM") field(EISV, "NO_ALARM") field(PINI, "YES") field(NIVL, "9") field(TEVL, "10") field(ELVL, "11") field(TVVL, "12") field(TTVL, "13") field(FTVL, "14") field(FFVL, "15") field(NIST, "960 KHz") field(TEST, "3.84 KHz") field(ELST, "7.68 KHz") field(TVST, "9.6 KHz") field(TTST, "15.36 KHz") field(FTST, "48 KHz") field(FFST, "96 KHz") field(NISV, "NO_ALARM") field(TESV, "NO_ALARM") field(ELSV, "NO_ALARM") field(TVSV, "NO_ALARM") field(TTSV, "NO_ALARM") field(FTSV, "NO_ALARM") field(FFSV, "NO_ALARM") } record(longin, "MCOR:AS01:100:MODEL") { field(DESC, "Module Model No.") field(DTYP, "Hytec IP-ADC-8413") field(INP, "@ai0:5:ID") field(PINI, "YES") } record(longin, "MCOR:AS01:100:REV") { field(DESC, "Module Revision No.") field(DTYP, "Hytec IP-ADC-8413") field(INP, "@ai0:6:ID") field(PINI, "YES") } record(longin, "MCOR:AS01:100:SERNO") { field(DESC, "Module Serial No.") field(DTYP, "Hytec IP-ADC-8413") field(INP, "@ai0:13:ID") field(PINI, "YES") } record(mbbi, "MCOR:AS01:100:CALBTYPE") { field(DESC, "ADC Modu Calb Type") field(DTYP, "Hytec IP-ADC-8413") field(INP, "@ai0:12:ID") field(NOBT, "2") field(ZRST, "No Calibration") field(ONST, "3-Point") field(TWST, "5-Point") field(ZRVL, "0") field(ONVL, "1") field(TWVL, "2") field(ZRSV, "MAJOR") field(ONSV, "NO_ALARM") field(TWSV, "NO_ALARM") field(PINI, "YES") } # Generic information record(longout, "MCOR:AS01:100:CRATE") { field(DESC, "Crate Number") field(DTYP, "Soft Channel") field(HOPR, "10") field(LOPR, "1") field(DRVH, "10") field(DRVL, "1") field(PINI, "YES") field(VAL, "1") } record(stringout, "MCOR:AS01:100:TYPE") { field(DESC, "MCOR Crate") field(PINI, "YES") field(VAL, "BiRa MCOR Crate Model 2513") } record(stringout, "MCOR:AS01:100:LOCATION") { field(DESC, "Rack Location") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "B044-ASTA-0116") } record(stringout, "MCOR:AS01:100:DRAWING") { field(DESC, "SODA Drawing No.") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "CAPTAR") } ###################################### # Bulk Power Supply PVs (Soft PVs) record(bo, "MCOR:AS01:100:PS_STATE") { field(DESC, "Bulk PS On/Off State") field(DOL, "LGPS:AS01:1:STATE CPP MS") field(OMSL, "closed_loop") field(ZNAM, "OFF") field(ONAM, "ON") field(FLNK, "MCOR:AS01:100:PS_STATE_SEQ.PROC") } record(dfanout, "MCOR:AS01:100:PS_STATE_SEQ") { field(DESC, "Bulk PS On/Off State fanout") field(ASG, "Internal") field(DOL, "MCOR:AS01:100:PS_STATE MS") field(OMSL, "closed_loop") field(OUTA, "MCOR:AS01:101:STATE_CALC.A PP") field(OUTB, "MCOR:AS01:102:STATE_CALC.A PP") field(OUTC, "MCOR:AS01:103:STATE_CALC.A PP") field(OUTD, "MCOR:AS01:104:STATE_CALC.A PP") field(OUTE, "MCOR:AS01:105:STATE_CALC.A PP") field(OUTF, "MCOR:AS01:106:STATE_CALC.A PP") field(OUTG, "MCOR:AS01:107:STATE_CALC.A PP") field(OUTH, "MCOR:AS01:108:STATE_CALC.A PP") field(FLNK, "MCOR:AS01:100:PS_STATE_SEQ_2.PROC") } record(dfanout, "MCOR:AS01:100:PS_STATE_SEQ_2") { field(DESC, "Bulk PS On/Off State fanout") field(ASG, "Internal") field(DOL, "MCOR:AS01:100:PS_STATE MS") field(OMSL, "closed_loop") field(OUTA, "MCOR:AS01:109:STATE_CALC.A PP") field(OUTB, "MCOR:AS01:110:STATE_CALC.A PP") field(OUTC, "MCOR:AS01:111:STATE_CALC.A PP") field(OUTD, "MCOR:AS01:112:STATE_CALC.A PP") field(OUTE, "MCOR:AS01:113:STATE_CALC.A PP") field(OUTF, "MCOR:AS01:114:STATE_CALC.A PP") field(OUTG, "MCOR:AS01:115:STATE_CALC.A PP") field(OUTH, "MCOR:AS01:116:STATE_CALC.A PP") } record(bo, "MCOR:AS01:100:PS_TURNEDOFF") { field(DESC, "Bulk PS Turned Off by User") field(DOL, "LGPS:AS01:1:TURNEDOFF CPP MS") field(OMSL, "closed_loop") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") field(FLNK, "MCOR:AS01:100:PS_TURNEDOFF_SEQ.PROC") } record(dfanout, "MCOR:AS01:100:PS_TURNEDOFF_SEQ") { field(DESC, "PS Turned Off Fanout") field(ASG, "Internal") field(DOL, "MCOR:AS01:100:PS_TURNEDOFF") field(OMSL, "closed_loop") field(OUTA, "MCOR:AS01:101:TURNEDOFF PP") field(OUTB, "MCOR:AS01:102:TURNEDOFF PP") field(OUTC, "MCOR:AS01:103:TURNEDOFF PP") field(OUTD, "MCOR:AS01:104:TURNEDOFF PP") field(OUTE, "MCOR:AS01:105:TURNEDOFF PP") field(OUTF, "MCOR:AS01:106:TURNEDOFF PP") field(OUTG, "MCOR:AS01:107:TURNEDOFF PP") field(OUTH, "MCOR:AS01:108:TURNEDOFF PP") field(FLNK, "MCOR:AS01:100:PS_TURNEDOFF_SEQ_2.PROC") } record(dfanout, "MCOR:AS01:100:PS_TURNEDOFF_SEQ_2") { field(DESC, "PS Turned Off Fanout") field(ASG, "Internal") field(DOL, "MCOR:AS01:100:PS_TURNEDOFF") field(OMSL, "closed_loop") field(OUTA, "MCOR:AS01:109:TURNEDOFF PP") field(OUTB, "MCOR:AS01:110:TURNEDOFF PP") field(OUTC, "MCOR:AS01:111:TURNEDOFF PP") field(OUTD, "MCOR:AS01:112:TURNEDOFF PP") field(OUTE, "MCOR:AS01:113:TURNEDOFF PP") field(OUTF, "MCOR:AS01:114:TURNEDOFF PP") field(OUTG, "MCOR:AS01:115:TURNEDOFF PP") field(OUTH, "MCOR:AS01:116:TURNEDOFF PP") } record(bo, "MCOR:AS01:100:RESET") { field(DESC, "Reset MCOR Faults") field(DTYP, "Raw Soft Channel") field(ZNAM, "NORESET") field(ONAM, "RESET") # If no hardware exists then OUT should be set to blank field(OUT, "LGPS:AS01:1:RESET PP") } # Bulk Power Supply Fault Status record(bo, "MCOR:AS01:100:PS_LATCHED_FAULTSTATE") { field(DESC, "Bulk PS Fault State") field(DOL, "LGPS:AS01:1:INTLKSUMY CPP MS") field(OMSL, "closed_loop") field(ZNAM, "OK") field(ONAM, "FAULT") field(FLNK, "MCOR:AS01:100:PS_LATCHED_FAULTSTATE_SEQ.PROC") } record(dfanout, "MCOR:AS01:100:PS_LATCHED_FAULTSTATE_SEQ") { field(DESC, "Bulk PS Fault State fanout") field(ASG, "Internal") field(DOL, "MCOR:AS01:100:PS_LATCHED_FAULTSTATE MS") field(OMSL, "closed_loop") field(OUTA, "MCOR:AS01:101:INTLKSUMY_CALC.B PP") field(OUTB, "MCOR:AS01:102:INTLKSUMY_CALC.B PP") field(OUTC, "MCOR:AS01:103:INTLKSUMY_CALC.B PP") field(OUTD, "MCOR:AS01:104:INTLKSUMY_CALC.B PP") field(OUTE, "MCOR:AS01:105:INTLKSUMY_CALC.B PP") field(OUTF, "MCOR:AS01:106:INTLKSUMY_CALC.B PP") field(OUTG, "MCOR:AS01:107:INTLKSUMY_CALC.B PP") field(OUTH, "MCOR:AS01:108:INTLKSUMY_CALC.B PP") field(FLNK, "MCOR:AS01:100:PS_LATCHED_FAULTSTATE_SEQ_2.PROC") } record(dfanout, "MCOR:AS01:100:PS_LATCHED_FAULTSTATE_SEQ_2") { field(DESC, "Bulk PS Fault State fanout") field(ASG, "Internal") field(DOL, "MCOR:AS01:100:PS_LATCHED_FAULTSTATE MS") field(OMSL, "closed_loop") field(OUTA, "MCOR:AS01:109:INTLKSUMY_CALC.B PP") field(OUTB, "MCOR:AS01:110:INTLKSUMY_CALC.B PP") field(OUTC, "MCOR:AS01:111:INTLKSUMY_CALC.B PP") field(OUTD, "MCOR:AS01:112:INTLKSUMY_CALC.B PP") field(OUTE, "MCOR:AS01:113:INTLKSUMY_CALC.B PP") field(OUTF, "MCOR:AS01:114:INTLKSUMY_CALC.B PP") field(OUTG, "MCOR:AS01:115:INTLKSUMY_CALC.B PP") field(OUTH, "MCOR:AS01:116:INTLKSUMY_CALC.B PP") } #! 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:AS01:MG03:STATESETPT") { field(DESC, "PS On/Off") field(DTYP, "EtherPSC") field(OUT, "#L0 N0 P0 S1 @134.79.219.13") field(ZNAM, "OFF") field(ONAM, "ON") field(DOL, "BEND:AS01:931:STATESETPT") field(OMSL, "supervisory") info(autosaveFields,"VAL RVAL") } record(bo, "PSC:AS01:MG03:RESET") { field(DESC, "Interlock Reset") field(DTYP, "EtherPSC") field(OUT, "#L0 N0 P0 S2 @134.79.219.13") field(ZNAM, "RESET") field(ONAM, "NORESET") field(DOL, "BEND:AS01:931:RESET.RVAL") field(OMSL, "supervisory") } record(ao, "PSC:AS01:MG03:IRAMPRATE") { field(DESC, "Ramp rate dI/dt") field(DTYP, "EtherPSC") field(OUT, "#L0 N0 P0 S4 @134.79.219.13") 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, "BEND:AS01:931:IRAMPRATE") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(bi, "PSC:AS01:MG03:RAMPSTATE") { field(DESC, "Ramping Status") field(DTYP, "EtherPSC") field(INP, "#L0 N0 P0 S9 @134.79.219.13") field(ZNAM, "OFF") field(ONAM, "BUSY") field(ZSV, "NO_ALARM") field(OSV, "MINOR") field(FLNK, "BEND:AS01:931:RAMPSTATE") } record(bi, "PSC:AS01:MG03:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "EtherPSC") field(INP, "#L0 N0 P0 S10 @134.79.219.13") field(ZNAM, "OFF") field(ONAM, "ON") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(FLNK, "BEND:AS01:931:STATE") } record(bi, "PSC:AS01:MG03:READY") { field(DESC, "PS Ready Fault") field(DTYP, "EtherPSC") field(INP, "#L0 N0 P0 S11 @134.79.219.13") field(ZNAM, "NOTREADY") field(ONAM, "READY") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") } record(bi, "PSC:AS01:MG03:MAGNET0STATUS") { field(DESC, "Therm 1 Switch Status") field(DTYP, "EtherPSC") field(INP, "#L0 N0 P0 S12 @134.79.219.13") field(ZNAM, "FAULT") field(ONAM, "OK") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") } record(bi, "PSC:AS01:MG03:MAGNET1STATUS") { field(DESC, "Magnet Interlock 1 Status") field(DTYP, "EtherPSC") field(INP, "#L0 N0 P0 S13 @134.79.219.13") field(ZNAM, "FAULT") field(ONAM, "OK") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") } record(bi, "PSC:AS01:MG03:MAGNET2STATUS") { field(DESC, "Magnet Interlock 2 Status") field(DTYP, "EtherPSC") field(INP, "#L0 N0 P0 S14 @134.79.219.13") field(ZNAM, "FAULT") field(ONAM, "OK") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") } # Water Flow Switch. record(bi, "PSC:AS01:MG03:MAGNET3STATUS") { field(DESC, "Water Flow Switch Status") field(DTYP, "EtherPSC") field(INP, "#L0 N0 P0 S15 @134.79.219.13") field(ZNAM, "FAULT") field(ONAM, "OK") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(FLNK, "PSC:AS01:MG03:MAGNET1STATUS") } record(bi, "PSC:AS01:MG03:IACTSTATUS") { field(DESC, "Regulated Xductor Status") field(DTYP, "EtherPSC") field(INP, "#L0 N0 P0 S16 @134.79.219.13") field(ZNAM, "FAULT") field(ONAM, "OK") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") } record(bi, "PSC:AS01:MG03:IGNDSTATUS") { field(DESC, "Ground Current Fault") field(DTYP, "EtherPSC") field(INP, "#L0 N0 P0 S17 @134.79.219.13") field(ZNAM, "FAULT") field(ONAM, "OK") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") } record(bi, "PSC:AS01:MG03:FAULTSTATUS") { field(DESC, "Fault Latch") field(DTYP, "EtherPSC") field(INP, "#L0 N0 P0 S18 @134.79.219.13") field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "MINOR") field(OSV, "NO_ALARM") } record(bi, "PSC:AS01:MG03:PSSTATE") { field(DESC, "PS on Readback") field(DTYP, "EtherPSC") field(INP, "#L0 N0 P0 S19 @134.79.219.13") 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:AS01:MG03:PS0STATUS") { field(DESC, "PS Status 0") field(DTYP, "EtherPSC") field(INP, "#L0 N0 P0 S20 @134.79.219.13") field(ZNAM, "FAULT") field(ONAM, "OK") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") } record(bi, "PSC:AS01:MG03:PS1STATUS") { field(DESC, "PS Status 1") field(DTYP, "EtherPSC") field(INP, "#L0 N0 P0 S21 @134.79.219.13") field(ZNAM, "FAULT") field(ONAM, "OK") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") } record(bi, "PSC:AS01:MG03:PS2STATUS") { field(DESC, "PS Status 2") field(DTYP, "EtherPSC") field(INP, "#L0 N0 P0 S22 @134.79.219.13") field(ZNAM, "FAULT") field(ONAM, "OK") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") } record(bi, "PSC:AS01:MG03:PS3STATUS") { field(DESC, "PS Status 3") field(DTYP, "EtherPSC") field(INP, "#L0 N0 P0 S23 @134.79.219.13") field(ZNAM, "FAULT") field(ONAM, "OK") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") } record(bi, "PSC:AS01:MG03:IMONSTATUS") { field(DESC, "Aux Xductor Interlock Status") field(DTYP, "EtherPSC") field(INP, "#L0 N0 P0 S24 @134.79.219.13") field(ZNAM, "FAULT") field(ONAM, "OK") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") } record(bi, "PSC:AS01:MG03:MODE") { field(DESC, "Local Mode") field(DTYP, "EtherPSC") field(INP, "#L0 N0 P0 S25 @134.79.219.13") field(ZNAM, "LOCAL") field(ONAM, "REMOTE") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") } record(calc, "PSC:AS01:MG03:CALBITOL") { field(DESC, "Calbration tolerance") field(EGU, "A") field(CALC, "(A-B)*C") field(A, "2.0") field(B, "0") field(C, "0.01") field(PREC, "6") field(PINI, "YES") } record(bi, "PSC:AS01:MG03:CALBOK_R") { field(DESC, "Calibration Status") field(DTYP, "EtherPSC") field(INP, "#L0 N0 P0 S26 @134.79.219.13") field(ZNAM, "FAULT") field(ONAM, "OK") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(FLNK,"PSC:AS01:MG03: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:AS01:MG03:CALBCALC") { field(DESC, "Calibration Status") field(CALC, "ABS(B)0)||(C>0)?1:0") field(INPA, "PS:AS01:1:FaultStatus CPP NMS") field(INPB, "PS:AS01:1:FaultStatus.SEVR NPP NMS") field(INPC, "PS:AS01:1:FaultEvent CPP NMS") field(INPD, "PS:AS01:1:FaultEvent.SEVR NPP NMS") field(OOPT, "Every Time") field(FLNK, "PS:AS01:1:LatchedFaultState") } record(bi, "PS:AS01:1:LatchedFaultState") { field(DESC, "Fault Latch Status") field(INP, "PS:AS01:1:LatchedFaultStateCalc NPP NMS") field(ONAM, "FAULT") field(ZNAM, "OK") field(OSV, "MAJOR") field(ZSV, "NO_ALARM") field(FLNK, "LGPS:AS01:1:INTLKSUMY PP MS") } # Status Conditional Register is set by the user to Enable # SRQs for changes in power supply status. record(longout, "PS:AS01:1:StatusEnable") { field(DESC, "Enable Status Events") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-setsena(06) LGPS_AS01_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:AS01:1:StatusEvent") { field(DESC, "Status Event Register") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getseve(06) LGPS_AS01_1") field(FLNK, "PS:AS01:1:StatusEventSeq") } record(seq, "PS:AS01: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:AS01:1:StatusEvent") field(LNK3, "PS:AS01:1:FaultEvent.PROC PP") field(LNK4, "PS:AS01:1:FaultEvent.PROC PP") } record(mbbiDirect, "PS:AS01:1:OperStatus") { field(DESC, "Status Conditional Register") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getstat(06) LGPS_AS01_1") field(PINI, "YES") field(FLNK, "PS:AS01:1:VoltMode") } record(bi, "PS:AS01:1:VoltMode") { field(DESC, "Voltage Mode") field(INP, "PS:AS01:1:OperStatus.B0 MS") field(ZNAM, "Not Constant") field(ONAM, "Constant") field(FLNK, "PS:AS01:1:CurrMode") } record(bi, "PS:AS01:1:CurrMode") { field(DESC, "Current Mode") field(INP, "PS:AS01:1:OperStatus.B1 MS") field(ZNAM, "Not Constant") field(ONAM, "Constant") field(FLNK, "PS:AS01:1:NoFaultState") } record(bi, "PS:AS01:1:NoFaultState") { field(DESC, "No Fault Status") field(INP, "PS:AS01:1:OperStatus.B2 MS") field(ZNAM, "FAULT") field(ONAM, "OK") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(FLNK, "PS:AS01:1:ActiveFaultState") } record(bi, "PS:AS01:1:ActiveFaultState") { field(DESC, "Active Fault Status") field(INP, "PS:AS01:1:OperStatus.B3 MS") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "NO_ALARM") field(FLNK, "PS:AS01: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:AS01:1:AutoStartMode") { field(DESC, "Auto Start Mode") field(INP, "PS:AS01:1:OperStatus.B4 MS") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(FLNK, "PS:AS01: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:AS01:1:FoldBackMode") { field(DESC, "Fold Back Protection") field(INP, "PS:AS01:1:OperStatus.B5 MS") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:AS01:1:Mode") } record(bi, "PS:AS01:1:Mode") { field(DESC, "Local Mode") field(INP, "PS:AS01:1:OperStatus.B7 MS") field(ZNAM, "REMOTE") field(ONAM, "LOCAL") field(ZSV, "NO_ALARM") field(OSV, "MINOR") } record(bo, "PS:AS01:1:FoldBackEnable") { field(DESC, "Fold Back Protection") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-setfld(06) LGPS_AS01_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:AS01:1:Addr") { field(DESC, "Power Supply Address") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-comsetadr(06) LGPS_AS01_1") field(DOL, "06") field(OMSL, "closed_loop") } record(mbbo, "PS:AS01: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:AS01:1:MsgResp") } record(mbbi, "PS:AS01:1:MsgResp") { field(DESC, "Message Response") field(INP, "PS:AS01: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:AS01:1:GetAnything") { field(DESC, "Get Anything") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto debug(06) LGPS_AS01_1") } record(stringout, "PS:AS01:1:SetAnything") { field(DESC, "Set anything") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-set(06) LGPS_AS01_1") } record(mbbo, "PS:AS01: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:AS01:1:COOLING PP") } record(bo, "PS:AS01:1:RampState") { field(DESC, "PS Ramp Status") field(ZNAM, "OFF") field(ONAM, "BUSY") field(PINI, "YES") field(OUT, "LGPS:AS01:1:RAMPSTATE PP") } record(stringin, "PS:AS01:1:Drawing") { field(DESC, "Drawing Number") field(VAL, "See CAPTAR") field(PINI, "YES") } record(stringin, "PS:AS01:1:Location") { field(DESC, "Rack Location") field(VAL, "B044-ASTA-0109") field(PINI, "YES") } record(bo, "PS:AS01:1:CommLink") { field(DESC, "Communication Link Status") field(PINI, "YES") field(ZNAM, "Offline") field(ONAM, "Online") field(FLNK, "PS:AS01:1:InitCommLinkCalc") } record(calcout,"PS:AS01:1:InitCommLinkCalc") { field(DESC, "Init Pvs") field(OOPT, "Transition To Non-zero") field(FLNK, "PS:AS01:1:InitCommLink") field(ASG, "Internal") } record(dfanout,"PS:AS01:1:InitCommLink") { field(DESC, "PS Init") field(DOL, "0") field(OMSL, "closed_loop") field(OUTA, "PS:AS01:1:Addr.PROC PP") field(OUTB, "PS:AS01:1:State.PROC PP") field(OUTC, "PS:AS01:1:FaultEnable.PROC PP") field(OUTD, "PS:AS01:1:StatusEnable.PROC PP") field(OUTE, "PS:AS01:1:ResetSeq.PROC PP") field(OUTF, "PS:AS01:1:StatusEvent.PROC PP") field(OUTG, "PS:AS01:1:OperStatus.PROC PP") field(OUTH, "PS:AS01:1:IDN.PROC PP") field(FLNK, "PS:AS01:1:InitCurrSetpt") field(ASG, "Internal") } # Process VSETPT on IOC startup record(seq,"PS:AS01:1:InitCurrSetpt") { field(DESC, "Init current setpoint") field(DOL1, "0") field(LNK1, "PS:AS01:1:VoltSetpt.DISV") field(LNK2, "PS:AS01:1:CurrSetptOut.PROC") field(DOL3, "1") field(LNK3, "PS:AS01:1:VoltSetpt.DISV") field(ASG, "Internal") } record(asyn,"IOC:AS01:MG01:ASYNDRIVER") { field(DTYP,"asynRecordDevice") field(PORT,"LGPS_AS01_1") field(ADDR,"6") field(OMAX,"0") field(IMAX,"0") }