#================================== #---------------------------------- # prc_prl.template: # # Phase Reference Line support # for a single PRC chassis # # PREF - rack or chassis name # LCLS2 example: ACCL:L1B:0200:RACKA # NAME - FEED device name # LCLS2 example: prca #---------------------------------- #================================== record(longin, "$(CM,undefined)00:RACKA:PRL_INIT1_") { field(DTYP, "FEED On Connect") field(INP , "@name=$(PRCA=prca,undefined)") field(SCAN, "I/O Intr") field(PHAS, "0") field(FLNK, "$(CM,undefined)00:RACKA:PRL_ENABLE") } # Indicates which PRL inputs are used # EPICS owns this; lcls2_llrf phs_avg.py # reads this PV record(mbbi, "$(CM,undefined)00:RACKA:PRL_MODE") { field(VAL, "$(PRLMODE,recursive)") field(ZRVL, "0") field(ZRST, "Fwd/Rev") field(ONVL, "1") field(ONST, "Fwd Only") field(TWVL, "2") field(TWST, "Rev Only") field(THVL, "3") field(THST, "None") field(PINI, "YES") info(autosaveFields, "VAL") } # Dummy PV to allow python API to access actual PV record(longin, "$(CM,undefined)00:RACKA:PRL_MODEDMY") { field(DTYP, "FEED Register Read") field(INP , "@name=$(PRCA=prca,undefined) reg=mbox_PRL_MODE") info(feed:info:input, "$(CM,undefined)00:RACKA:PRL_MODE") info(feed:info:output, "$(CM,undefined)00:RACKA:PRL_MODE") } # Nominal PRL forward/reverse offset # Set by expert, once or rarely # Also called unique phase offset record(longin, "$(CM,undefined)00:RACKA:PRL_OFFSET_NOM") { field(DESC, "Nominal PRL fwd-rev phase offset") field(SCAN, "Passive") field(VAL, "0") field(EGU, "degrees") field(LOPR, "-180") field(HOPR, "180") field(PINI, "YES") field(FLNK, "$(CM,undefined)00:RACKA:PRL_OFFSET_NOM_TS1_") info(autosaveFields, "VAL") } # Dummy PV to allow python API to access actual PV record(longin, "$(CM,undefined)00:RACKA:PRL_OFFSET_NOMDMY") { field(DTYP, "FEED Register Read") field(INP , "@name=$(PRCA=prca,undefined) reg=mbox_PRL_OFFSET_NOM") info(feed:info:input, "$(CM,undefined)00:RACKA:PRL_OFFSET_NOM") info(feed:info:output, "$(CM,undefined)00:RACKA:PRL_OFFSET_NOM") } # Records to update timestamp only when nominal # offset is changed (and not over-written at IOC startup) record(calcout, "$(CM,undefined)00:RACKA:PRL_OFFSET_NOM_TS1_") { field(DESC, "PRL nominal offset change") field(CALC, "A") field(INPA, "$(CM,undefined)00:RACKA:PRL_OFFSET_NOM") field(OOPT, "On Change") field(OUT, "$(CM,undefined)00:RACKA:PRL_OFFSET_NOM_TS2_ PP") info(autosaveFields, "A VAL") } record(stringin, "$(CM,undefined)00:RACKA:PRL_OFFSET_NOM_TS2_") { field(DESC, "PRL nominal offset change") field(DTYP, "Soft Timestamp") field(INP, "@%m/%d/%Y %H:%M:%S") field(FLNK, "$(CM,undefined)00:RACKA:PRL_OFFSET_NOM_TS3_") } record(stringout, "$(CM,undefined)00:RACKA:PRL_OFFSET_NOM_TS3_") { field(DESC, "PRL nominal offset change") field(OMSL, "closed_loop") field(DOL, "$(CM,undefined)00:RACKA:PRL_OFFSET_NOM_TS2_") field(OUT, "$(CM,undefined)00:RACKA:PRL_OFFSET_NOM_TS PP") field(FLNK, "$(CM,undefined)00:RACKA:PRL_OFFSET") } record(stringout, "$(CM,undefined)00:RACKA:PRL_OFFSET_NOM_TS") { field(DESC, "PRL nominal offset last changed") field(PINI, "YES") info(autosaveFields, "VAL") } # In unscaled units (0-1 range) # Default value from phs_avg.py record(ai, "$(CM,undefined)00:RACKA:PRL_AMPL_THRESH") { field(DESC, "Minimum ampl to calc offset") field(VAL, ".05") field(PINI, "YES") info(autosaveFields, "VAL") } record(aSub, "$(CM,undefined)00:RACKA:PRL_OFFSET_CALC") { field(SNAM, "Calculate PRL Offset") # If subroutine returns -1, set to INVALID # Downstream records inherit this severity field(BRSV, "INVALID") # PRLREV updates last in the set, so # should have synchronous data field(INPA, "$(CM,undefined)00:RACKA:PRLFWD:AMEAN MSI NPP") field(INPB, "$(CM,undefined)00:RACKA:PRLREV:AMEAN MSI NPP") field(INPC, "$(CM,undefined)00:RACKA:PRLFWD:PMEAN MSI NPP") field(INPD, "$(CM,undefined)00:RACKA:PRLREV:PMEAN MSI CP") field(FTE, "SHORT") field(INPE, "$(CM,undefined)00:RACKA:PRL_MODE MSI") field(INPF, "$(CM,undefined)00:RACKA:PRL_OFFSET_NOM MSI") field(INPG, "$(CM,undefined)00:RACKA:PRLFWD:SCALE MSI") field(INPH, "$(CM,undefined)00:RACKA:PRLREV:SCALE MSI") field(INPI, "$(CM,undefined)00:RACKA:PRL_AMPL_THRESH") field(NOVA, "1") # Phase offset [degrees] field(OUTA, "$(CM,undefined)00:RACKA:PRL_OFFSET PP MS") field(FTVB, "SHORT") field(OUTB, "$(CM,undefined)00:RACKA:PRL_OFFSET_STAT PP MS") field(FTVC, "STRING") field(NOVC, "1") field(OUTC, "$(CM,undefined)00:RACKA:PRL_OFFSET_MSG PP MS") field(FTVD, "STRING") field(NOVD, "1") field(OUTD, "$(CM,undefined)00:RACKA:PRL_OFFSET_TS PP MS") field(TSEL, "$(CM,undefined)00:RACKA:PRLREV:AWF.TIME") } record(mbbi, "$(CM,undefined)00:RACKA:PRL_OFFSET_STAT") { field(VAL, "0") field(ZRVL, "0") field(ZRST, "Good") field(ONVL, "1") field(ONST, "Warning") field(ONSV, "MINOR") field(TWVL, "2") field(TWST, "Error") field(TWSV, "MAJOR") field(PINI, "YES") info(autosaveFields, "VAL") } record(stringin, "$(CM,undefined)00:RACKA:PRL_OFFSET_MSG") { field(VAL, "") field(PINI, "YES") info(autosaveFields, "VAL") } # Timestamp last successfully calculated OFFSET record(stringin, "$(CM,undefined)00:RACKA:PRL_OFFSET_TS") { field(VAL, "") field(PINI, "YES") info(autosaveFields, "VAL") } # PRL forward/reverse offset # Calculated from waveforms record(longin, "$(CM,undefined)00:RACKA:PRL_OFFSET") { field(DESC, "PRL fwd-rev phase offset") field(SCAN, "Passive") field(VAL, "0") field(EGU, "degrees") field(LOPR, "-180") field(HOPR, "180") field(FLNK, "$(CM,undefined)00:RACKA:PRL_OFFSET_DIFF") field(TSEL, "$(CM,undefined)00:RACKA:PRLREV:AWF.TIME") info(autosaveFields, "VAL") } # Dummy PV to allow python API to access actual PV record(longin, "$(CM,undefined)00:RACKA:PRL_OFFSETDMY") { field(DTYP, "FEED Register Read") field(INP , "@name=$(PRCA=prca,undefined) reg=mbox_PRL_OFFSET") info(feed:info:input, "$(CM,undefined)00:RACKA:PRL_OFFSET") info(feed:info:output, "$(CM,undefined)00:RACKA:PRL_OFFSET") } record(calc, "$(CM,undefined)00:RACKA:PRL_OFFSET_DIFF") { field(DESC, "PRL offset - nominal") field(CALC, "A-B") field(INPA, "$(CM,undefined)00:RACKA:PRL_OFFSET") field(INPB, "$(CM,undefined)00:RACKA:PRL_OFFSET_NOM") field(LLSV, "MAJOR") field(LSV, "MINOR") field(HSV, "MINOR") field(HHSV, "MAJOR") field(LOLO, "-10") field(LOW, "-9") field(HIGH, "9") field(HIHI, "10") field(PREC, "0") field(EGU, "degrees") } record(bo, "$(CM,undefined)00:RACKA:PRL_OFFSET_RESET") { field(DESC, "Set current to nominal") field(SCAN, "Passive") field(ZNAM, "Reset") field(ONAM, "Reset") field(FLNK, "$(CM,undefined)00:RACKA:PRL_OFFSET_RESET_") } record(seq, "$(CM,undefined)00:RACKA:PRL_OFFSET_RESET_") { field(DESC, "Set current to nominal") field(SCAN, "Passive") field(SELM, "All") field(DOL0, "$(CM,undefined)00:RACKA:PRL_OFFSET") field(LNK0, "$(CM,undefined)00:RACKA:PRL_OFFSET_NOM PP") field(DOL1, "1") # Optional link to notify users to check phases field(LNK1, "$(CKPLNKA,undefined)") } # PRL forward/reverse offset # Measured at hardware init record(longin, "$(CM,undefined)00:RACKA:PRL_OFFSET_INIT") { field(DESC, "PRL fwd-rev phase offset meas at init") field(SCAN, "Passive") field(VAL, "0") field(EGU, "degrees") field(LOPR, "-180") field(HOPR, "180") info(autosaveFields, "VAL") } # Dummy PV to allow python API to access actual PV record(longin, "$(CM,undefined)00:RACKA:PRL_OFFSET_INITDMY") { field(DTYP, "FEED Register Read") field(INP , "@name=$(PRCA=prca,undefined) reg=mbox_PRL_OFFSET_INIT") info(feed:info:input, "$(CM,undefined)00:RACKA:PRL_OFFSET_INIT") info(feed:info:output, "$(CM,undefined)00:RACKA:PRL_OFFSET_INIT") } # Read-only, 18-bit angle # This will have a random offset (2*pi*n/66?) per reboot. # From S Murthy, convert to degrees by scaling by360*0.5**19 # See rfs_prl.template for bit transmitted to RFS record(ai, "$(CM,undefined)00:RACKA:REG_PRL_ZERO") { field(DESC, "Corrected phase between LO and PRL") field(DTYP, "FEED Register Read") field(SCAN, "1 second") field(EGU, "degrees") field(ASLO, "0.000686645507812") field(INP , "@name=$(PRCA=prca,undefined) reg=phase_zero_mon") field(TSE , "-2") field(FLNK, "$(CM,undefined)00:RACKA:PRL_ZERO") } # REG_PRL_ZERO was named before understanding the # conversion to degrees. Adding PRL_ZERO on top # because it is easier than renaming in existing systems record(ai, "$(CM,undefined)00:RACKA:PRL_ZERO") { field(DESC, "Corrected phase between LO and PRL") field(EGU, "degrees") field(INP , "$(CM,undefined)00:RACKA:REG_PRL_ZERO MSI") field(TSEL, "$(CM,undefined)00:RACKA:REG_PRL_ZERO.TIME") } record(bo, "$(CM,undefined)00:RACKA:PRL_ENABLE") { field(DESC, "Enable PRL tracking") field(ZNAM, "Disable") field(ONAM, "Enable") field(VAL, "0") field(PINI, "YES") field(FLNK, "$(CM,undefined)00:RACKA:PRL_ENABLE_") info(autosaveFields, "VAL") } record(calcout, "$(CM,undefined)00:RACKA:PRL_ENABLE_") { field(DESC, "Enable PRL tracking") field(SCAN, "Passive") field(CALC, "C?A|B:A&(!B)") field(INPA, "$(CM,undefined)00:RACKA:REG_PRL_CTL_RBV") # Bit 8 aka 0x100 aka 256 is phase tracking enable field(INPB, "256") field(INPC, "$(CM,undefined)00:RACKA:PRL_ENABLE") field(OOPT, "Every Time") field(OUT, "$(CM,undefined)00:RACKA:REG_PRL_CTL PP") } # Set REG_PRL_CTL OMSL closed_loop to only retrieve value from PRL_ENABLE_? # Set bit 8 (0x100) to enable phase reference tracking # When zero, the phase_zero value above is forced to zero. record(longout, "$(CM,undefined)00:RACKA:REG_PRL_CTL") { field(DTYP, "FEED Register Write") field(OMSL, "supervisory") field(OUT , "@name=$(PRCA=prca,undefined) reg=prc_dsp_prl_cfg wait=false") info(feed:info:output, "$(CM,undefined)00:RACKA:REG_PRL_CTL") } record(longin, "$(CM,undefined)00:RACKA:REG_PRL_CTL_RBV") { field(DTYP, "FEED Register Read") field(SCAN, "1 second") field(INP , "@name=$(PRCA=prca,undefined) reg=prc_dsp_prl_cfg") field(TSE , "-2") field(FLNK, "$(CM,undefined)00:RACKA:PRL_ENABLE_RBV_") info(feed:info:input, "$(CM,undefined)00:RACKA:REG_PRL_CTL_RBV") } record(calc, "$(CM,undefined)00:RACKA:PRL_ENABLE_RBV_") { field(DESC, "PRL tracking enabled") field(SCAN, "Passive") field(CALC, "(A&B)?1:0") field(INPA, "$(CM,undefined)00:RACKA:REG_PRL_CTL_RBV") # Bit 8 aka 0x100 aka 256 is phase tracking enable field(INPB, "256") field(FLNK, "$(CM,undefined)00:RACKA:PRL_ENABLE_RBV") } record(bi, "$(CM,undefined)00:RACKA:PRL_ENABLE_RBV") { field(DESC, "PRL tracking enabled") field(INP, "$(CM,undefined)00:RACKA:PRL_ENABLE_RBV_") field(ZNAM, "Not enabled") field(ZSV, "MAJOR") field(ONAM, "Enabled") } # Gain registers 16-bit signed # (not expected to be set by humans) record(longout, "$(CM,undefined)00:RACKA:REG_PRLFWD_GAIN_I") { field(DTYP, "FEED Register Write") field(OMSL, "supervisory") field(OUT , "@name=$(PRCA=prca,undefined) reg=prc_dsp_phs_avg_i_kx_0 wait=false") field(LOPR, "-32767") field(HOPR, "32767") info(feed:info:output, "$(CM,undefined)00:RACKA:REG_PRLFWD_GAIN_I") } record(longin, "$(CM,undefined)00:RACKA:REG_PRLFWD_GAIN_I_RBV") { field(DTYP, "FEED Register Read") field(SCAN, "1 second") field(INP , "@name=$(PRCA=prca,undefined) reg=prc_dsp_phs_avg_i_kx_0") field(TSE , "-2") field(LOPR, "-32767") field(HOPR, "32767") info(feed:info:input, "$(CM,undefined)00:RACKA:REG_PRLFWD_GAIN_I_RBV") } record(longout, "$(CM,undefined)00:RACKA:REG_PRLFWD_GAIN_Q") { field(DTYP, "FEED Register Write") field(OMSL, "supervisory") field(OUT , "@name=$(PRCA=prca,undefined) reg=prc_dsp_phs_avg_i_kx_1 wait=false") field(LOPR, "-32767") field(HOPR, "32767") info(feed:info:output, "$(CM,undefined)00:RACKA:REG_PRLFWD_GAIN_Q") } record(longin, "$(CM,undefined)00:RACKA:REG_PRLFWD_GAIN_Q_RBV") { field(DTYP, "FEED Register Read") field(SCAN, "1 second") field(INP , "@name=$(PRCA=prca,undefined) reg=prc_dsp_phs_avg_i_kx_1") field(TSE , "-2") field(LOPR, "-32767") field(HOPR, "32767") info(feed:info:input, "$(CM,undefined)00:RACKA:REG_PRLFWD_GAIN_Q_RBV") } record(longout, "$(CM,undefined)00:RACKA:REG_PRLREV_GAIN_I") { field(DTYP, "FEED Register Write") field(OMSL, "supervisory") field(OUT , "@name=$(PRCA=prca,undefined) reg=prc_dsp_phs_avg_i_kx_0 wait=false") field(LOPR, "-32767") field(HOPR, "32767") info(feed:info:output, "$(CM,undefined)00:RACKA:REG_PRLREV_GAIN_I") } record(longin, "$(CM,undefined)00:RACKA:REG_PRLREV_GAIN_I_RBV") { field(DTYP, "FEED Register Read") field(SCAN, "1 second") field(INP , "@name=$(PRCA=prca,undefined) reg=prc_dsp_phs_avg_i_kx_0") field(TSE , "-2") field(LOPR, "-32767") field(HOPR, "32767") info(feed:info:input, "$(CM,undefined)00:RACKA:REG_PRLREV_GAIN_I_RBV") } record(longout, "$(CM,undefined)00:RACKA:REG_PRLREV_GAIN_Q") { field(DTYP, "FEED Register Write") field(OMSL, "supervisory") field(OUT , "@name=$(PRCA=prca,undefined) reg=prc_dsp_phs_avg_i_kx_1 wait=false") field(LOPR, "-32767") field(HOPR, "32767") info(feed:info:output, "$(CM,undefined)00:RACKA:REG_PRLREV_GAIN_Q") } record(longin, "$(CM,undefined)00:RACKA:REG_PRLREV_GAIN_Q_RBV") { field(DTYP, "FEED Register Read") field(SCAN, "1 second") field(INP , "@name=$(PRCA=prca,undefined) reg=prc_dsp_phs_avg_i_kx_1") field(TSE , "-2") field(LOPR, "-32767") field(HOPR, "32767") info(feed:info:input, "$(CM,undefined)00:RACKA:REG_PRLREV_GAIN_Q_RBV") } # Forward and Reverse PRL signal strength # Needed by the math; could be acquired and snapshotted as part of # that process # Add units, precision, hopr/lopr? record(ai, "$(CM,undefined)00:RACKA:PRLFWD_MAGN") { field(DESC, "PRL fwd signal strength") field(SCAN, "Passive") field(VAL, "0") field(PINI, "YES") info(autosaveFields, "VAL") } # Dummy PV to allow python API to access actual PV record(longin, "$(CM,undefined)00:RACKA:PRLFWD_MAGNDMY") { field(DTYP, "FEED Register Read") field(INP , "@name=$(PRCA=prca,undefined) reg=mbox_PRLFWD_MAGN") info(feed:info:input, "$(CM,undefined)00:RACKA:PRLFWD_MAGN") info(feed:info:output, "$(CM,undefined)00:RACKA:PRLFWD_MAGN") } record(ai, "$(CM,undefined)00:RACKA:PRLREV_MAGN") { field(DESC, "PRL rev signal strength") field(SCAN, "Passive") field(VAL, "0") field(PINI, "YES") info(autosaveFields, "VAL") } # Dummy PV to allow python API to access actual PV record(longin, "$(CM,undefined)00:RACKA:PRLREV_MAGNDMY") { field(DTYP, "FEED Register Read") field(INP , "@name=$(PRCA=prca,undefined) reg=mbox_PRLREV_MAGN") info(feed:info:input, "$(CM,undefined)00:RACKA:PRLREV_MAGN") info(feed:info:output, "$(CM,undefined)00:RACKA:PRLREV_MAGN") } # PRL tracking bandwidth. From LD: # SI units of Hz, max valid value around 300 kHz. Set by hand. I hope # a single value around 500 Hz will be adequate everywhere. # See LCLSII-2.7-FR-0648, MO/LO and PRL Requirements for LLRF. record(ao, "$(CM,undefined)00:RACKA:PRL_TRACK_BW") { field(DESC, "PRL tracking bandwidth") field(SCAN, "Passive") field(VAL, "10000") field(EGU, "Hz") field(LOPR, "0") field(HOPR, "300000") field(DRVL, "0") field(DRVH, "300000") info(autosaveFields, "VAL") } # Dummy PV to allow python API to access actual PV record(longin, "$(CM,undefined)00:RACKA:PRL_TRACK_BWDMY") { field(DTYP, "FEED Register Read") field(INP , "@name=$(PRCA=prca,undefined) reg=mbox_PRL_TRACK_BW") info(feed:info:input, "$(CM,undefined)00:RACKA:PRL_TRACK_BW") info(feed:info:output, "$(CM,undefined)00:RACKA:PRL_TRACK_BW") } # Tentatively reserved for rack checkout record(mbbi, "$(CM,undefined)00:RACKA:PRL_CHKSTAT") { field(VAL, "0") field(ZRVL, "0") field(ZRST, "Good") field(ONVL, "1") field(ONST, "Warning") field(ONSV, "MINOR") field(TWVL, "2") field(TWST, "Error") field(TWSV, "MAJOR") field(PINI, "YES") info(autosaveFields, "VAL") } # Dummy PV to allow python API to access actual PV record(longin, "$(CM,undefined)00:RACKA:PRL_CHKSTATDMY") { field(DTYP, "FEED Register Read") field(INP , "@name=$(PRCA=prca,undefined) reg=mbox_PRL_CHKSTAT") info(feed:info:input, "$(CM,undefined)00:RACKA:PRL_CHKSTAT") info(feed:info:output, "$(CM,undefined)00:RACKA:PRL_CHKSTAT") } # From L Doolittle 2 Nov 2022 # prl_fault_mon is only interesting/useful when read from the PRC. # prl_fault_from_prc_icc is that same info transferred to the RFS. # Each of them is a read-and-clear 1-bit register. Read it as often # as you want, and it will report if any faults happened since the # last time you checked. The threshold is fixed, at a level where # we don't think it will trip in normal operations. # From git commit # Generates a PRL fault bit if sum_filt value from phs_avg.v # >0.01 or <-0.01 degrees # PRL fault bit, only valid on PRC # See rfs_prl.template for bit transmitted to RFS record(mbbi, "$(CM,undefined)00:PRCA:PRLFLT") { field(DTYP, "FEED Register Read") field(INP , "@name=$(PRCA=prca,undefined) reg=prl_fault_mon") field(SCAN, "1 second") field(ZRVL, "0") field(ONVL, "1") field(ONSV, "MAJOR") field(ZRST, "Ok") field(ONST, "Fault") field(TSE , "-2") } #================================== #---------------------------------- # prc_prl.template: # # Phase Reference Line support # for a single PRC chassis # # PREF - rack or chassis name # LCLS2 example: ACCL:L1B:0200:RACKA # NAME - FEED device name # LCLS2 example: prca #---------------------------------- #================================== record(longin, "$(CM,undefined)00:RACKB:PRL_INIT1_") { field(DTYP, "FEED On Connect") field(INP , "@name=$(PRCB=prcb,undefined)") field(SCAN, "I/O Intr") field(PHAS, "0") field(FLNK, "$(CM,undefined)00:RACKB:PRL_ENABLE") } # Indicates which PRL inputs are used # EPICS owns this; lcls2_llrf phs_avg.py # reads this PV record(mbbi, "$(CM,undefined)00:RACKB:PRL_MODE") { field(VAL, "$(PRLMODE,recursive)") field(ZRVL, "0") field(ZRST, "Fwd/Rev") field(ONVL, "1") field(ONST, "Fwd Only") field(TWVL, "2") field(TWST, "Rev Only") field(THVL, "3") field(THST, "None") field(PINI, "YES") info(autosaveFields, "VAL") } # Dummy PV to allow python API to access actual PV record(longin, "$(CM,undefined)00:RACKB:PRL_MODEDMY") { field(DTYP, "FEED Register Read") field(INP , "@name=$(PRCB=prcb,undefined) reg=mbox_PRL_MODE") info(feed:info:input, "$(CM,undefined)00:RACKB:PRL_MODE") info(feed:info:output, "$(CM,undefined)00:RACKB:PRL_MODE") } # Nominal PRL forward/reverse offset # Set by expert, once or rarely # Also called unique phase offset record(longin, "$(CM,undefined)00:RACKB:PRL_OFFSET_NOM") { field(DESC, "Nominal PRL fwd-rev phase offset") field(SCAN, "Passive") field(VAL, "0") field(EGU, "degrees") field(LOPR, "-180") field(HOPR, "180") field(PINI, "YES") field(FLNK, "$(CM,undefined)00:RACKB:PRL_OFFSET_NOM_TS1_") info(autosaveFields, "VAL") } # Dummy PV to allow python API to access actual PV record(longin, "$(CM,undefined)00:RACKB:PRL_OFFSET_NOMDMY") { field(DTYP, "FEED Register Read") field(INP , "@name=$(PRCB=prcb,undefined) reg=mbox_PRL_OFFSET_NOM") info(feed:info:input, "$(CM,undefined)00:RACKB:PRL_OFFSET_NOM") info(feed:info:output, "$(CM,undefined)00:RACKB:PRL_OFFSET_NOM") } # Records to update timestamp only when nominal # offset is changed (and not over-written at IOC startup) record(calcout, "$(CM,undefined)00:RACKB:PRL_OFFSET_NOM_TS1_") { field(DESC, "PRL nominal offset change") field(CALC, "A") field(INPA, "$(CM,undefined)00:RACKB:PRL_OFFSET_NOM") field(OOPT, "On Change") field(OUT, "$(CM,undefined)00:RACKB:PRL_OFFSET_NOM_TS2_ PP") info(autosaveFields, "A VAL") } record(stringin, "$(CM,undefined)00:RACKB:PRL_OFFSET_NOM_TS2_") { field(DESC, "PRL nominal offset change") field(DTYP, "Soft Timestamp") field(INP, "@%m/%d/%Y %H:%M:%S") field(FLNK, "$(CM,undefined)00:RACKB:PRL_OFFSET_NOM_TS3_") } record(stringout, "$(CM,undefined)00:RACKB:PRL_OFFSET_NOM_TS3_") { field(DESC, "PRL nominal offset change") field(OMSL, "closed_loop") field(DOL, "$(CM,undefined)00:RACKB:PRL_OFFSET_NOM_TS2_") field(OUT, "$(CM,undefined)00:RACKB:PRL_OFFSET_NOM_TS PP") field(FLNK, "$(CM,undefined)00:RACKB:PRL_OFFSET") } record(stringout, "$(CM,undefined)00:RACKB:PRL_OFFSET_NOM_TS") { field(DESC, "PRL nominal offset last changed") field(PINI, "YES") info(autosaveFields, "VAL") } # In unscaled units (0-1 range) # Default value from phs_avg.py record(ai, "$(CM,undefined)00:RACKB:PRL_AMPL_THRESH") { field(DESC, "Minimum ampl to calc offset") field(VAL, ".05") field(PINI, "YES") info(autosaveFields, "VAL") } record(aSub, "$(CM,undefined)00:RACKB:PRL_OFFSET_CALC") { field(SNAM, "Calculate PRL Offset") # If subroutine returns -1, set to INVALID # Downstream records inherit this severity field(BRSV, "INVALID") # PRLREV updates last in the set, so # should have synchronous data field(INPA, "$(CM,undefined)00:RACKB:PRLFWD:AMEAN MSI NPP") field(INPB, "$(CM,undefined)00:RACKB:PRLREV:AMEAN MSI NPP") field(INPC, "$(CM,undefined)00:RACKB:PRLFWD:PMEAN MSI NPP") field(INPD, "$(CM,undefined)00:RACKB:PRLREV:PMEAN MSI CP") field(FTE, "SHORT") field(INPE, "$(CM,undefined)00:RACKB:PRL_MODE MSI") field(INPF, "$(CM,undefined)00:RACKB:PRL_OFFSET_NOM MSI") field(INPG, "$(CM,undefined)00:RACKB:PRLFWD:SCALE MSI") field(INPH, "$(CM,undefined)00:RACKB:PRLREV:SCALE MSI") field(INPI, "$(CM,undefined)00:RACKB:PRL_AMPL_THRESH") field(NOVA, "1") # Phase offset [degrees] field(OUTA, "$(CM,undefined)00:RACKB:PRL_OFFSET PP MS") field(FTVB, "SHORT") field(OUTB, "$(CM,undefined)00:RACKB:PRL_OFFSET_STAT PP MS") field(FTVC, "STRING") field(NOVC, "1") field(OUTC, "$(CM,undefined)00:RACKB:PRL_OFFSET_MSG PP MS") field(FTVD, "STRING") field(NOVD, "1") field(OUTD, "$(CM,undefined)00:RACKB:PRL_OFFSET_TS PP MS") field(TSEL, "$(CM,undefined)00:RACKB:PRLREV:AWF.TIME") } record(mbbi, "$(CM,undefined)00:RACKB:PRL_OFFSET_STAT") { field(VAL, "0") field(ZRVL, "0") field(ZRST, "Good") field(ONVL, "1") field(ONST, "Warning") field(ONSV, "MINOR") field(TWVL, "2") field(TWST, "Error") field(TWSV, "MAJOR") field(PINI, "YES") info(autosaveFields, "VAL") } record(stringin, "$(CM,undefined)00:RACKB:PRL_OFFSET_MSG") { field(VAL, "") field(PINI, "YES") info(autosaveFields, "VAL") } # Timestamp last successfully calculated OFFSET record(stringin, "$(CM,undefined)00:RACKB:PRL_OFFSET_TS") { field(VAL, "") field(PINI, "YES") info(autosaveFields, "VAL") } # PRL forward/reverse offset # Calculated from waveforms record(longin, "$(CM,undefined)00:RACKB:PRL_OFFSET") { field(DESC, "PRL fwd-rev phase offset") field(SCAN, "Passive") field(VAL, "0") field(EGU, "degrees") field(LOPR, "-180") field(HOPR, "180") field(FLNK, "$(CM,undefined)00:RACKB:PRL_OFFSET_DIFF") field(TSEL, "$(CM,undefined)00:RACKB:PRLREV:AWF.TIME") info(autosaveFields, "VAL") } # Dummy PV to allow python API to access actual PV record(longin, "$(CM,undefined)00:RACKB:PRL_OFFSETDMY") { field(DTYP, "FEED Register Read") field(INP , "@name=$(PRCB=prcb,undefined) reg=mbox_PRL_OFFSET") info(feed:info:input, "$(CM,undefined)00:RACKB:PRL_OFFSET") info(feed:info:output, "$(CM,undefined)00:RACKB:PRL_OFFSET") } record(calc, "$(CM,undefined)00:RACKB:PRL_OFFSET_DIFF") { field(DESC, "PRL offset - nominal") field(CALC, "A-B") field(INPA, "$(CM,undefined)00:RACKB:PRL_OFFSET") field(INPB, "$(CM,undefined)00:RACKB:PRL_OFFSET_NOM") field(LLSV, "MAJOR") field(LSV, "MINOR") field(HSV, "MINOR") field(HHSV, "MAJOR") field(LOLO, "-10") field(LOW, "-9") field(HIGH, "9") field(HIHI, "10") field(PREC, "0") field(EGU, "degrees") } record(bo, "$(CM,undefined)00:RACKB:PRL_OFFSET_RESET") { field(DESC, "Set current to nominal") field(SCAN, "Passive") field(ZNAM, "Reset") field(ONAM, "Reset") field(FLNK, "$(CM,undefined)00:RACKB:PRL_OFFSET_RESET_") } record(seq, "$(CM,undefined)00:RACKB:PRL_OFFSET_RESET_") { field(DESC, "Set current to nominal") field(SCAN, "Passive") field(SELM, "All") field(DOL0, "$(CM,undefined)00:RACKB:PRL_OFFSET") field(LNK0, "$(CM,undefined)00:RACKB:PRL_OFFSET_NOM PP") field(DOL1, "1") # Optional link to notify users to check phases field(LNK1, "$(CKPLNKB,undefined)") } # PRL forward/reverse offset # Measured at hardware init record(longin, "$(CM,undefined)00:RACKB:PRL_OFFSET_INIT") { field(DESC, "PRL fwd-rev phase offset meas at init") field(SCAN, "Passive") field(VAL, "0") field(EGU, "degrees") field(LOPR, "-180") field(HOPR, "180") info(autosaveFields, "VAL") } # Dummy PV to allow python API to access actual PV record(longin, "$(CM,undefined)00:RACKB:PRL_OFFSET_INITDMY") { field(DTYP, "FEED Register Read") field(INP , "@name=$(PRCB=prcb,undefined) reg=mbox_PRL_OFFSET_INIT") info(feed:info:input, "$(CM,undefined)00:RACKB:PRL_OFFSET_INIT") info(feed:info:output, "$(CM,undefined)00:RACKB:PRL_OFFSET_INIT") } # Read-only, 18-bit angle # This will have a random offset (2*pi*n/66?) per reboot. # From S Murthy, convert to degrees by scaling by360*0.5**19 # See rfs_prl.template for bit transmitted to RFS record(ai, "$(CM,undefined)00:RACKB:REG_PRL_ZERO") { field(DESC, "Corrected phase between LO and PRL") field(DTYP, "FEED Register Read") field(SCAN, "1 second") field(EGU, "degrees") field(ASLO, "0.000686645507812") field(INP , "@name=$(PRCB=prcb,undefined) reg=phase_zero_mon") field(TSE , "-2") field(FLNK, "$(CM,undefined)00:RACKB:PRL_ZERO") } # REG_PRL_ZERO was named before understanding the # conversion to degrees. Adding PRL_ZERO on top # because it is easier than renaming in existing systems record(ai, "$(CM,undefined)00:RACKB:PRL_ZERO") { field(DESC, "Corrected phase between LO and PRL") field(EGU, "degrees") field(INP , "$(CM,undefined)00:RACKB:REG_PRL_ZERO MSI") field(TSEL, "$(CM,undefined)00:RACKB:REG_PRL_ZERO.TIME") } record(bo, "$(CM,undefined)00:RACKB:PRL_ENABLE") { field(DESC, "Enable PRL tracking") field(ZNAM, "Disable") field(ONAM, "Enable") field(VAL, "0") field(PINI, "YES") field(FLNK, "$(CM,undefined)00:RACKB:PRL_ENABLE_") info(autosaveFields, "VAL") } record(calcout, "$(CM,undefined)00:RACKB:PRL_ENABLE_") { field(DESC, "Enable PRL tracking") field(SCAN, "Passive") field(CALC, "C?A|B:A&(!B)") field(INPA, "$(CM,undefined)00:RACKB:REG_PRL_CTL_RBV") # Bit 8 aka 0x100 aka 256 is phase tracking enable field(INPB, "256") field(INPC, "$(CM,undefined)00:RACKB:PRL_ENABLE") field(OOPT, "Every Time") field(OUT, "$(CM,undefined)00:RACKB:REG_PRL_CTL PP") } # Set REG_PRL_CTL OMSL closed_loop to only retrieve value from PRL_ENABLE_? # Set bit 8 (0x100) to enable phase reference tracking # When zero, the phase_zero value above is forced to zero. record(longout, "$(CM,undefined)00:RACKB:REG_PRL_CTL") { field(DTYP, "FEED Register Write") field(OMSL, "supervisory") field(OUT , "@name=$(PRCB=prcb,undefined) reg=prc_dsp_prl_cfg wait=false") info(feed:info:output, "$(CM,undefined)00:RACKB:REG_PRL_CTL") } record(longin, "$(CM,undefined)00:RACKB:REG_PRL_CTL_RBV") { field(DTYP, "FEED Register Read") field(SCAN, "1 second") field(INP , "@name=$(PRCB=prcb,undefined) reg=prc_dsp_prl_cfg") field(TSE , "-2") field(FLNK, "$(CM,undefined)00:RACKB:PRL_ENABLE_RBV_") info(feed:info:input, "$(CM,undefined)00:RACKB:REG_PRL_CTL_RBV") } record(calc, "$(CM,undefined)00:RACKB:PRL_ENABLE_RBV_") { field(DESC, "PRL tracking enabled") field(SCAN, "Passive") field(CALC, "(A&B)?1:0") field(INPA, "$(CM,undefined)00:RACKB:REG_PRL_CTL_RBV") # Bit 8 aka 0x100 aka 256 is phase tracking enable field(INPB, "256") field(FLNK, "$(CM,undefined)00:RACKB:PRL_ENABLE_RBV") } record(bi, "$(CM,undefined)00:RACKB:PRL_ENABLE_RBV") { field(DESC, "PRL tracking enabled") field(INP, "$(CM,undefined)00:RACKB:PRL_ENABLE_RBV_") field(ZNAM, "Not enabled") field(ZSV, "MAJOR") field(ONAM, "Enabled") } # Gain registers 16-bit signed # (not expected to be set by humans) record(longout, "$(CM,undefined)00:RACKB:REG_PRLFWD_GAIN_I") { field(DTYP, "FEED Register Write") field(OMSL, "supervisory") field(OUT , "@name=$(PRCB=prcb,undefined) reg=prc_dsp_phs_avg_i_kx_0 wait=false") field(LOPR, "-32767") field(HOPR, "32767") info(feed:info:output, "$(CM,undefined)00:RACKB:REG_PRLFWD_GAIN_I") } record(longin, "$(CM,undefined)00:RACKB:REG_PRLFWD_GAIN_I_RBV") { field(DTYP, "FEED Register Read") field(SCAN, "1 second") field(INP , "@name=$(PRCB=prcb,undefined) reg=prc_dsp_phs_avg_i_kx_0") field(TSE , "-2") field(LOPR, "-32767") field(HOPR, "32767") info(feed:info:input, "$(CM,undefined)00:RACKB:REG_PRLFWD_GAIN_I_RBV") } record(longout, "$(CM,undefined)00:RACKB:REG_PRLFWD_GAIN_Q") { field(DTYP, "FEED Register Write") field(OMSL, "supervisory") field(OUT , "@name=$(PRCB=prcb,undefined) reg=prc_dsp_phs_avg_i_kx_1 wait=false") field(LOPR, "-32767") field(HOPR, "32767") info(feed:info:output, "$(CM,undefined)00:RACKB:REG_PRLFWD_GAIN_Q") } record(longin, "$(CM,undefined)00:RACKB:REG_PRLFWD_GAIN_Q_RBV") { field(DTYP, "FEED Register Read") field(SCAN, "1 second") field(INP , "@name=$(PRCB=prcb,undefined) reg=prc_dsp_phs_avg_i_kx_1") field(TSE , "-2") field(LOPR, "-32767") field(HOPR, "32767") info(feed:info:input, "$(CM,undefined)00:RACKB:REG_PRLFWD_GAIN_Q_RBV") } record(longout, "$(CM,undefined)00:RACKB:REG_PRLREV_GAIN_I") { field(DTYP, "FEED Register Write") field(OMSL, "supervisory") field(OUT , "@name=$(PRCB=prcb,undefined) reg=prc_dsp_phs_avg_i_kx_0 wait=false") field(LOPR, "-32767") field(HOPR, "32767") info(feed:info:output, "$(CM,undefined)00:RACKB:REG_PRLREV_GAIN_I") } record(longin, "$(CM,undefined)00:RACKB:REG_PRLREV_GAIN_I_RBV") { field(DTYP, "FEED Register Read") field(SCAN, "1 second") field(INP , "@name=$(PRCB=prcb,undefined) reg=prc_dsp_phs_avg_i_kx_0") field(TSE , "-2") field(LOPR, "-32767") field(HOPR, "32767") info(feed:info:input, "$(CM,undefined)00:RACKB:REG_PRLREV_GAIN_I_RBV") } record(longout, "$(CM,undefined)00:RACKB:REG_PRLREV_GAIN_Q") { field(DTYP, "FEED Register Write") field(OMSL, "supervisory") field(OUT , "@name=$(PRCB=prcb,undefined) reg=prc_dsp_phs_avg_i_kx_1 wait=false") field(LOPR, "-32767") field(HOPR, "32767") info(feed:info:output, "$(CM,undefined)00:RACKB:REG_PRLREV_GAIN_Q") } record(longin, "$(CM,undefined)00:RACKB:REG_PRLREV_GAIN_Q_RBV") { field(DTYP, "FEED Register Read") field(SCAN, "1 second") field(INP , "@name=$(PRCB=prcb,undefined) reg=prc_dsp_phs_avg_i_kx_1") field(TSE , "-2") field(LOPR, "-32767") field(HOPR, "32767") info(feed:info:input, "$(CM,undefined)00:RACKB:REG_PRLREV_GAIN_Q_RBV") } # Forward and Reverse PRL signal strength # Needed by the math; could be acquired and snapshotted as part of # that process # Add units, precision, hopr/lopr? record(ai, "$(CM,undefined)00:RACKB:PRLFWD_MAGN") { field(DESC, "PRL fwd signal strength") field(SCAN, "Passive") field(VAL, "0") field(PINI, "YES") info(autosaveFields, "VAL") } # Dummy PV to allow python API to access actual PV record(longin, "$(CM,undefined)00:RACKB:PRLFWD_MAGNDMY") { field(DTYP, "FEED Register Read") field(INP , "@name=$(PRCB=prcb,undefined) reg=mbox_PRLFWD_MAGN") info(feed:info:input, "$(CM,undefined)00:RACKB:PRLFWD_MAGN") info(feed:info:output, "$(CM,undefined)00:RACKB:PRLFWD_MAGN") } record(ai, "$(CM,undefined)00:RACKB:PRLREV_MAGN") { field(DESC, "PRL rev signal strength") field(SCAN, "Passive") field(VAL, "0") field(PINI, "YES") info(autosaveFields, "VAL") } # Dummy PV to allow python API to access actual PV record(longin, "$(CM,undefined)00:RACKB:PRLREV_MAGNDMY") { field(DTYP, "FEED Register Read") field(INP , "@name=$(PRCB=prcb,undefined) reg=mbox_PRLREV_MAGN") info(feed:info:input, "$(CM,undefined)00:RACKB:PRLREV_MAGN") info(feed:info:output, "$(CM,undefined)00:RACKB:PRLREV_MAGN") } # PRL tracking bandwidth. From LD: # SI units of Hz, max valid value around 300 kHz. Set by hand. I hope # a single value around 500 Hz will be adequate everywhere. # See LCLSII-2.7-FR-0648, MO/LO and PRL Requirements for LLRF. record(ao, "$(CM,undefined)00:RACKB:PRL_TRACK_BW") { field(DESC, "PRL tracking bandwidth") field(SCAN, "Passive") field(VAL, "10000") field(EGU, "Hz") field(LOPR, "0") field(HOPR, "300000") field(DRVL, "0") field(DRVH, "300000") info(autosaveFields, "VAL") } # Dummy PV to allow python API to access actual PV record(longin, "$(CM,undefined)00:RACKB:PRL_TRACK_BWDMY") { field(DTYP, "FEED Register Read") field(INP , "@name=$(PRCB=prcb,undefined) reg=mbox_PRL_TRACK_BW") info(feed:info:input, "$(CM,undefined)00:RACKB:PRL_TRACK_BW") info(feed:info:output, "$(CM,undefined)00:RACKB:PRL_TRACK_BW") } # Tentatively reserved for rack checkout record(mbbi, "$(CM,undefined)00:RACKB:PRL_CHKSTAT") { field(VAL, "0") field(ZRVL, "0") field(ZRST, "Good") field(ONVL, "1") field(ONST, "Warning") field(ONSV, "MINOR") field(TWVL, "2") field(TWST, "Error") field(TWSV, "MAJOR") field(PINI, "YES") info(autosaveFields, "VAL") } # Dummy PV to allow python API to access actual PV record(longin, "$(CM,undefined)00:RACKB:PRL_CHKSTATDMY") { field(DTYP, "FEED Register Read") field(INP , "@name=$(PRCB=prcb,undefined) reg=mbox_PRL_CHKSTAT") info(feed:info:input, "$(CM,undefined)00:RACKB:PRL_CHKSTAT") info(feed:info:output, "$(CM,undefined)00:RACKB:PRL_CHKSTAT") } # From L Doolittle 2 Nov 2022 # prl_fault_mon is only interesting/useful when read from the PRC. # prl_fault_from_prc_icc is that same info transferred to the RFS. # Each of them is a read-and-clear 1-bit register. Read it as often # as you want, and it will report if any faults happened since the # last time you checked. The threshold is fixed, at a level where # we don't think it will trip in normal operations. # From git commit # Generates a PRL fault bit if sum_filt value from phs_avg.v # >0.01 or <-0.01 degrees # PRL fault bit, only valid on PRC # See rfs_prl.template for bit transmitted to RFS record(mbbi, "$(CM,undefined)00:PRCB:PRLFLT") { field(DTYP, "FEED Register Read") field(INP , "@name=$(PRCB=prcb,undefined) reg=prl_fault_mon") field(SCAN, "1 second") field(ZRVL, "0") field(ONVL, "1") field(ONSV, "MAJOR") field(ZRST, "Ok") field(ONST, "Fault") field(TSE , "-2") } #================================== #---------------------------------- # rfs_prl.template: # # Phase Reference Line support # for a single RFS chassis # # PREF - chassis name # LCLS2 example: ACCL:L1B:0200:RFS1A # NAME - FEED device name # LCLS2 example: rfs1a #---------------------------------- #================================== record(longin, "$(CM,undefined)00:RFS1A:PRL_INIT1_") { field(DTYP, "FEED On Connect") field(INP , "@name=$(RFS1A=rfs1a,undefined)") field(SCAN, "I/O Intr") field(PHAS, "0") # Placeholder for any future # registers that need to be set # upon software-hardware reconnect } # Phase zero from PRC record(ai, "$(CM,undefined)00:RFS1A:PRL_ZERO_PRC") { field(DTYP, "FEED Register Read") field(SCAN, "1 second") field(EGU, "degrees") field(ASLO, "0.000686645507812") field(INP , "@name=$(RFS1A=rfs1a,undefined) reg=phase_zero_rfs_mon") field(TSE , "-2") } # PRL fault bit transmitted from PRC to RFS # See prc_prl.template for bit read directly from PRC record(mbbi, "$(CM,undefined)00:RFS1A:PRLFLT_PRC") { field(DTYP, "FEED Register Read") field(INP , "@name=$(RFS1A=rfs1a,undefined) reg=prl_fault_from_prc_icc") field(SCAN, "1 second") field(ZRVL, "0") field(ONVL, "1") field(ONSV, "MAJOR") field(ZRST, "Ok") field(ONST, "Fault") field(TSE , "-2") } #================================== #---------------------------------- # rfs_prl.template: # # Phase Reference Line support # for a single RFS chassis # # PREF - chassis name # LCLS2 example: ACCL:L1B:0200:RFS1A # NAME - FEED device name # LCLS2 example: rfs1a #---------------------------------- #================================== record(longin, "$(CM,undefined)00:RFS2A:PRL_INIT1_") { field(DTYP, "FEED On Connect") field(INP , "@name=$(RFS2A=rfs2a,undefined)") field(SCAN, "I/O Intr") field(PHAS, "0") # Placeholder for any future # registers that need to be set # upon software-hardware reconnect } # Phase zero from PRC record(ai, "$(CM,undefined)00:RFS2A:PRL_ZERO_PRC") { field(DTYP, "FEED Register Read") field(SCAN, "1 second") field(EGU, "degrees") field(ASLO, "0.000686645507812") field(INP , "@name=$(RFS2A=rfs2a,undefined) reg=phase_zero_rfs_mon") field(TSE , "-2") } # PRL fault bit transmitted from PRC to RFS # See prc_prl.template for bit read directly from PRC record(mbbi, "$(CM,undefined)00:RFS2A:PRLFLT_PRC") { field(DTYP, "FEED Register Read") field(INP , "@name=$(RFS2A=rfs2a,undefined) reg=prl_fault_from_prc_icc") field(SCAN, "1 second") field(ZRVL, "0") field(ONVL, "1") field(ONSV, "MAJOR") field(ZRST, "Ok") field(ONST, "Fault") field(TSE , "-2") } #================================== #---------------------------------- # rfs_prl.template: # # Phase Reference Line support # for a single RFS chassis # # PREF - chassis name # LCLS2 example: ACCL:L1B:0200:RFS1A # NAME - FEED device name # LCLS2 example: rfs1a #---------------------------------- #================================== record(longin, "$(CM,undefined)00:RFS1B:PRL_INIT1_") { field(DTYP, "FEED On Connect") field(INP , "@name=$(RFS1A=rfs1b,undefined)") field(SCAN, "I/O Intr") field(PHAS, "0") # Placeholder for any future # registers that need to be set # upon software-hardware reconnect } # Phase zero from PRC record(ai, "$(CM,undefined)00:RFS1B:PRL_ZERO_PRC") { field(DTYP, "FEED Register Read") field(SCAN, "1 second") field(EGU, "degrees") field(ASLO, "0.000686645507812") field(INP , "@name=$(RFS1A=rfs1b,undefined) reg=phase_zero_rfs_mon") field(TSE , "-2") } # PRL fault bit transmitted from PRC to RFS # See prc_prl.template for bit read directly from PRC record(mbbi, "$(CM,undefined)00:RFS1B:PRLFLT_PRC") { field(DTYP, "FEED Register Read") field(INP , "@name=$(RFS1A=rfs1b,undefined) reg=prl_fault_from_prc_icc") field(SCAN, "1 second") field(ZRVL, "0") field(ONVL, "1") field(ONSV, "MAJOR") field(ZRST, "Ok") field(ONST, "Fault") field(TSE , "-2") } #================================== #---------------------------------- # rfs_prl.template: # # Phase Reference Line support # for a single RFS chassis # # PREF - chassis name # LCLS2 example: ACCL:L1B:0200:RFS1A # NAME - FEED device name # LCLS2 example: rfs1a #---------------------------------- #================================== record(longin, "$(CM,undefined)00:RFS2B:PRL_INIT1_") { field(DTYP, "FEED On Connect") field(INP , "@name=$(RFS2A=rfs2b,undefined)") field(SCAN, "I/O Intr") field(PHAS, "0") # Placeholder for any future # registers that need to be set # upon software-hardware reconnect } # Phase zero from PRC record(ai, "$(CM,undefined)00:RFS2B:PRL_ZERO_PRC") { field(DTYP, "FEED Register Read") field(SCAN, "1 second") field(EGU, "degrees") field(ASLO, "0.000686645507812") field(INP , "@name=$(RFS2A=rfs2b,undefined) reg=phase_zero_rfs_mon") field(TSE , "-2") } # PRL fault bit transmitted from PRC to RFS # See prc_prl.template for bit read directly from PRC record(mbbi, "$(CM,undefined)00:RFS2B:PRLFLT_PRC") { field(DTYP, "FEED Register Read") field(INP , "@name=$(RFS2A=rfs2b,undefined) reg=prl_fault_from_prc_icc") field(SCAN, "1 second") field(ZRVL, "0") field(ONVL, "1") field(ONSV, "MAJOR") field(ZRST, "Ok") field(ONST, "Fault") field(TSE , "-2") } #================================== #---------------------------------- # rfs_prl_cav.template: # # Phase Reference Line support # for RFS for a single cavity # # PREF - chassis name # LCLS2 example: ACCL:L1B:0210 # NAME - FEED device name # LCLS2 example: rfs1a # BIT - RFS zone, 0 or 1 #---------------------------------- #================================== record(longin, "$(CM,undefined)10:PRL_INIT1_") { field(DTYP, "FEED On Connect") field(INP , "@name=$(RFS1A=rfs1a,undefined)") field(SCAN, "I/O Intr") field(PHAS, "0") field(FLNK, "$(CM,undefined)10:PRL_ENABLE") } # Enable RFS use of PRL offset sent from PRC record(mbbo, "$(CM,undefined)10:PRL_ENABLE") { field(DESC, "Enable RFS PRL tracking") field(DTYP, "FEED Register Write") field(OMSL, "supervisory") field(OUT , "@name=$(RFS1A=rfs1a,undefined) reg=shell_0_dsp_prl_nco_prl_cfg_rfs wait=false") field(ZRST, "Disable") field(ZRVL, "0") field(ONST, "Enable") field(ONVL, "1") field(VAL, "0") field(PINI, "YES") info(feed:info:output, "$(CM,undefined)10:PRL_ENABLE") info(autosaveFields, "VAL") } record(mbbi, "$(CM,undefined)10:PRL_ENABLE_RBV") { field(DESC, "PRL tracking enabled") field(DTYP, "FEED Register Read") field(SCAN, "1 second") field(INP , "@name=$(RFS1A=rfs1a,undefined) reg=shell_0_dsp_prl_nco_prl_cfg_rfs") field(ZRST, "Not enabled") field(ZRVL, "0") field(ZRSV, "MINOR") field(ONST, "Enabled") field(ONVL, "1") } #================================== #---------------------------------- # rfs_prl_cav.template: # # Phase Reference Line support # for RFS for a single cavity # # PREF - chassis name # LCLS2 example: ACCL:L1B:0210 # NAME - FEED device name # LCLS2 example: rfs1a # BIT - RFS zone, 0 or 1 #---------------------------------- #================================== record(longin, "$(CM,undefined)20:PRL_INIT1_") { field(DTYP, "FEED On Connect") field(INP , "@name=$(RFS1A=rfs1a,undefined)") field(SCAN, "I/O Intr") field(PHAS, "0") field(FLNK, "$(CM,undefined)20:PRL_ENABLE") } # Enable RFS use of PRL offset sent from PRC record(mbbo, "$(CM,undefined)20:PRL_ENABLE") { field(DESC, "Enable RFS PRL tracking") field(DTYP, "FEED Register Write") field(OMSL, "supervisory") field(OUT , "@name=$(RFS1A=rfs1a,undefined) reg=shell_1_dsp_prl_nco_prl_cfg_rfs wait=false") field(ZRST, "Disable") field(ZRVL, "0") field(ONST, "Enable") field(ONVL, "1") field(VAL, "0") field(PINI, "YES") info(feed:info:output, "$(CM,undefined)20:PRL_ENABLE") info(autosaveFields, "VAL") } record(mbbi, "$(CM,undefined)20:PRL_ENABLE_RBV") { field(DESC, "PRL tracking enabled") field(DTYP, "FEED Register Read") field(SCAN, "1 second") field(INP , "@name=$(RFS1A=rfs1a,undefined) reg=shell_1_dsp_prl_nco_prl_cfg_rfs") field(ZRST, "Not enabled") field(ZRVL, "0") field(ZRSV, "MINOR") field(ONST, "Enabled") field(ONVL, "1") } #================================== #---------------------------------- # rfs_prl_cav.template: # # Phase Reference Line support # for RFS for a single cavity # # PREF - chassis name # LCLS2 example: ACCL:L1B:0210 # NAME - FEED device name # LCLS2 example: rfs1a # BIT - RFS zone, 0 or 1 #---------------------------------- #================================== record(longin, "$(CM,undefined)30:PRL_INIT1_") { field(DTYP, "FEED On Connect") field(INP , "@name=$(RFS2A=rfs2a,undefined)") field(SCAN, "I/O Intr") field(PHAS, "0") field(FLNK, "$(CM,undefined)30:PRL_ENABLE") } # Enable RFS use of PRL offset sent from PRC record(mbbo, "$(CM,undefined)30:PRL_ENABLE") { field(DESC, "Enable RFS PRL tracking") field(DTYP, "FEED Register Write") field(OMSL, "supervisory") field(OUT , "@name=$(RFS2A=rfs2a,undefined) reg=shell_0_dsp_prl_nco_prl_cfg_rfs wait=false") field(ZRST, "Disable") field(ZRVL, "0") field(ONST, "Enable") field(ONVL, "1") field(VAL, "0") field(PINI, "YES") info(feed:info:output, "$(CM,undefined)30:PRL_ENABLE") info(autosaveFields, "VAL") } record(mbbi, "$(CM,undefined)30:PRL_ENABLE_RBV") { field(DESC, "PRL tracking enabled") field(DTYP, "FEED Register Read") field(SCAN, "1 second") field(INP , "@name=$(RFS2A=rfs2a,undefined) reg=shell_0_dsp_prl_nco_prl_cfg_rfs") field(ZRST, "Not enabled") field(ZRVL, "0") field(ZRSV, "MINOR") field(ONST, "Enabled") field(ONVL, "1") } #================================== #---------------------------------- # rfs_prl_cav.template: # # Phase Reference Line support # for RFS for a single cavity # # PREF - chassis name # LCLS2 example: ACCL:L1B:0210 # NAME - FEED device name # LCLS2 example: rfs1a # BIT - RFS zone, 0 or 1 #---------------------------------- #================================== record(longin, "$(CM,undefined)40:PRL_INIT1_") { field(DTYP, "FEED On Connect") field(INP , "@name=$(RFS2A=rfs2a,undefined)") field(SCAN, "I/O Intr") field(PHAS, "0") field(FLNK, "$(CM,undefined)40:PRL_ENABLE") } # Enable RFS use of PRL offset sent from PRC record(mbbo, "$(CM,undefined)40:PRL_ENABLE") { field(DESC, "Enable RFS PRL tracking") field(DTYP, "FEED Register Write") field(OMSL, "supervisory") field(OUT , "@name=$(RFS2A=rfs2a,undefined) reg=shell_1_dsp_prl_nco_prl_cfg_rfs wait=false") field(ZRST, "Disable") field(ZRVL, "0") field(ONST, "Enable") field(ONVL, "1") field(VAL, "0") field(PINI, "YES") info(feed:info:output, "$(CM,undefined)40:PRL_ENABLE") info(autosaveFields, "VAL") } record(mbbi, "$(CM,undefined)40:PRL_ENABLE_RBV") { field(DESC, "PRL tracking enabled") field(DTYP, "FEED Register Read") field(SCAN, "1 second") field(INP , "@name=$(RFS2A=rfs2a,undefined) reg=shell_1_dsp_prl_nco_prl_cfg_rfs") field(ZRST, "Not enabled") field(ZRVL, "0") field(ZRSV, "MINOR") field(ONST, "Enabled") field(ONVL, "1") } #================================== #---------------------------------- # rfs_prl_cav.template: # # Phase Reference Line support # for RFS for a single cavity # # PREF - chassis name # LCLS2 example: ACCL:L1B:0210 # NAME - FEED device name # LCLS2 example: rfs1a # BIT - RFS zone, 0 or 1 #---------------------------------- #================================== record(longin, "$(CM,undefined)50:PRL_INIT1_") { field(DTYP, "FEED On Connect") field(INP , "@name=$(RFS1B=rfs1b,undefined)") field(SCAN, "I/O Intr") field(PHAS, "0") field(FLNK, "$(CM,undefined)50:PRL_ENABLE") } # Enable RFS use of PRL offset sent from PRC record(mbbo, "$(CM,undefined)50:PRL_ENABLE") { field(DESC, "Enable RFS PRL tracking") field(DTYP, "FEED Register Write") field(OMSL, "supervisory") field(OUT , "@name=$(RFS1B=rfs1b,undefined) reg=shell_0_dsp_prl_nco_prl_cfg_rfs wait=false") field(ZRST, "Disable") field(ZRVL, "0") field(ONST, "Enable") field(ONVL, "1") field(VAL, "0") field(PINI, "YES") info(feed:info:output, "$(CM,undefined)50:PRL_ENABLE") info(autosaveFields, "VAL") } record(mbbi, "$(CM,undefined)50:PRL_ENABLE_RBV") { field(DESC, "PRL tracking enabled") field(DTYP, "FEED Register Read") field(SCAN, "1 second") field(INP , "@name=$(RFS1B=rfs1b,undefined) reg=shell_0_dsp_prl_nco_prl_cfg_rfs") field(ZRST, "Not enabled") field(ZRVL, "0") field(ZRSV, "MINOR") field(ONST, "Enabled") field(ONVL, "1") } #================================== #---------------------------------- # rfs_prl_cav.template: # # Phase Reference Line support # for RFS for a single cavity # # PREF - chassis name # LCLS2 example: ACCL:L1B:0210 # NAME - FEED device name # LCLS2 example: rfs1a # BIT - RFS zone, 0 or 1 #---------------------------------- #================================== record(longin, "$(CM,undefined)60:PRL_INIT1_") { field(DTYP, "FEED On Connect") field(INP , "@name=$(RFS1B=rfs1b,undefined)") field(SCAN, "I/O Intr") field(PHAS, "0") field(FLNK, "$(CM,undefined)60:PRL_ENABLE") } # Enable RFS use of PRL offset sent from PRC record(mbbo, "$(CM,undefined)60:PRL_ENABLE") { field(DESC, "Enable RFS PRL tracking") field(DTYP, "FEED Register Write") field(OMSL, "supervisory") field(OUT , "@name=$(RFS1B=rfs1b,undefined) reg=shell_1_dsp_prl_nco_prl_cfg_rfs wait=false") field(ZRST, "Disable") field(ZRVL, "0") field(ONST, "Enable") field(ONVL, "1") field(VAL, "0") field(PINI, "YES") info(feed:info:output, "$(CM,undefined)60:PRL_ENABLE") info(autosaveFields, "VAL") } record(mbbi, "$(CM,undefined)60:PRL_ENABLE_RBV") { field(DESC, "PRL tracking enabled") field(DTYP, "FEED Register Read") field(SCAN, "1 second") field(INP , "@name=$(RFS1B=rfs1b,undefined) reg=shell_1_dsp_prl_nco_prl_cfg_rfs") field(ZRST, "Not enabled") field(ZRVL, "0") field(ZRSV, "MINOR") field(ONST, "Enabled") field(ONVL, "1") } #================================== #---------------------------------- # rfs_prl_cav.template: # # Phase Reference Line support # for RFS for a single cavity # # PREF - chassis name # LCLS2 example: ACCL:L1B:0210 # NAME - FEED device name # LCLS2 example: rfs1a # BIT - RFS zone, 0 or 1 #---------------------------------- #================================== record(longin, "$(CM,undefined)70:PRL_INIT1_") { field(DTYP, "FEED On Connect") field(INP , "@name=$(RFS2B=rfs2b,undefined)") field(SCAN, "I/O Intr") field(PHAS, "0") field(FLNK, "$(CM,undefined)70:PRL_ENABLE") } # Enable RFS use of PRL offset sent from PRC record(mbbo, "$(CM,undefined)70:PRL_ENABLE") { field(DESC, "Enable RFS PRL tracking") field(DTYP, "FEED Register Write") field(OMSL, "supervisory") field(OUT , "@name=$(RFS2B=rfs2b,undefined) reg=shell_0_dsp_prl_nco_prl_cfg_rfs wait=false") field(ZRST, "Disable") field(ZRVL, "0") field(ONST, "Enable") field(ONVL, "1") field(VAL, "0") field(PINI, "YES") info(feed:info:output, "$(CM,undefined)70:PRL_ENABLE") info(autosaveFields, "VAL") } record(mbbi, "$(CM,undefined)70:PRL_ENABLE_RBV") { field(DESC, "PRL tracking enabled") field(DTYP, "FEED Register Read") field(SCAN, "1 second") field(INP , "@name=$(RFS2B=rfs2b,undefined) reg=shell_0_dsp_prl_nco_prl_cfg_rfs") field(ZRST, "Not enabled") field(ZRVL, "0") field(ZRSV, "MINOR") field(ONST, "Enabled") field(ONVL, "1") } #================================== #---------------------------------- # rfs_prl_cav.template: # # Phase Reference Line support # for RFS for a single cavity # # PREF - chassis name # LCLS2 example: ACCL:L1B:0210 # NAME - FEED device name # LCLS2 example: rfs1a # BIT - RFS zone, 0 or 1 #---------------------------------- #================================== record(longin, "$(CM,undefined)80:PRL_INIT1_") { field(DTYP, "FEED On Connect") field(INP , "@name=$(RFS2B=rfs2b,undefined)") field(SCAN, "I/O Intr") field(PHAS, "0") field(FLNK, "$(CM,undefined)80:PRL_ENABLE") } # Enable RFS use of PRL offset sent from PRC record(mbbo, "$(CM,undefined)80:PRL_ENABLE") { field(DESC, "Enable RFS PRL tracking") field(DTYP, "FEED Register Write") field(OMSL, "supervisory") field(OUT , "@name=$(RFS2B=rfs2b,undefined) reg=shell_1_dsp_prl_nco_prl_cfg_rfs wait=false") field(ZRST, "Disable") field(ZRVL, "0") field(ONST, "Enable") field(ONVL, "1") field(VAL, "0") field(PINI, "YES") info(feed:info:output, "$(CM,undefined)80:PRL_ENABLE") info(autosaveFields, "VAL") } record(mbbi, "$(CM,undefined)80:PRL_ENABLE_RBV") { field(DESC, "PRL tracking enabled") field(DTYP, "FEED Register Read") field(SCAN, "1 second") field(INP , "@name=$(RFS2B=rfs2b,undefined) reg=shell_1_dsp_prl_nco_prl_cfg_rfs") field(ZRST, "Not enabled") field(ZRVL, "0") field(ZRSV, "MINOR") field(ONST, "Enabled") field(ONVL, "1") }