# per IOC database for stripline BPMs #record(sub, "VIOC:L3A1:BPM:FIDP") { # field(DESC, "BPM Fiducial Processing") # field(SNAM, "bpmEvrFidProcess") # #This tells us if there is beam during this cycle... # field(INPA, "VIOC:L3A1:BPM:MODIFIER5.R") #} #record(mbbo, "VIOC:L3A1:BPM:PATTERNSIM") { # field(DESC, "Pattern Simulation") # field(ZRST, "Off") # field(ONST, "Soft") # field(TWST, "Raw") # field(DOL, "0") # field(PINI, "YES") #} record(sub, "VIOC:L3A1:BPM:EVTM") { field(SNAM, "subEventTestTiming") field(SCAN, "Event") field(EVNT, "40") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBDEND # per BPM database for stripline BPMs ############################################## # This is the head of the main processing chain # that runs at the highest priority. ############################################## ############################################# # This is the head of the processing chain for # diagnostics. ############################################## record(ai, "HL2:SBPM:HL36:GRN") { field(DESC, "GRN Strip Amplitude") field(DTYP, "Raw Bpm Signal") # 'card' selects PAD number, 'signal' selects strip field(INP, "#C0 S0") field(EGU, "raw") #TODO set HOPR/LOPR, alarm limits field(SCAN, "I/O Intr") # The priority determines what scan list we are being # put on (see drvPadUdpComm.c) field(PRIO, "LOW") field(FLNK, "HL2:SBPM:HL36:RED") # HOPR for the energy algorithm is determined as follows: # # inf inf # 1) Fourier relation / h^2 dt = / |H|^2 df = 2 B # 0 -inf # # 1a) It can be shown that the maximum of the impuls response # ha is ~ 2 B # # 2) The digitizer produces the numbers # # Ai = 2^s (hi/ha) # # where ha is the maximum of the impuls response # and 2^s is a scale factor. # # 3) 'Energy algorithm' calculates S = sum( Ai^2 ) # # inf # 4) S = (2^s / ha)^2 sum(hi^2) = K sum(hi^2) Dt ~ K / h^2 dt # 0 # # with K = (2^s / ha)^2 fs # # 5) From 4) and 1a) -> S ~ K ha and therefore # # 6) S = 2^(2s) fs/ha = 2^(2s) fs/(2 B) # # 7) The strip signals are sqrt(S); hence HOPR is about # # HOPR ~ 2^s sqrt( fs/2/B ) # # with 2^s = 32768, fs=120MHz, B=10MHz it follows # that HOPR ~ 1E5; we add some margin... field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(ai, "HL2:SBPM:HL36:RED") { field(DESC, "RED Strip Amplitude") field(DTYP, "Raw Bpm Signal") # 'card' selects PAD number, 'signal' selects strip field(INP, "#C0 S1") field(EGU, "raw") field(SCAN, "Passive") field(FLNK, "HL2:SBPM:HL36:BLU") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(ai, "HL2:SBPM:HL36:BLU") { field(DESC, "BLU Strip Amplitude") field(DTYP, "Raw Bpm Signal") # 'card' selects PAD number, 'signal' selects strip field(INP, "#C0 S2") field(EGU, "raw") field(SCAN, "Passive") field(FLNK, "HL2:SBPM:HL36:YLO") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(ai, "HL2:SBPM:HL36:YLO") { field(DESC, "YLO Strip Amplitude") field(DTYP, "Raw Bpm Signal") # 'card' selects PAD number, 'signal' selects strip field(INP, "#C0 S3") field(EGU, "raw") field(SCAN, "Passive") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } ############################################## # Slowly-scanned diagnostics ############################################## # record(waveform, "HL2:SBPM:HL36:REDW") { field(DESC, "Raw CAL RED Data") field(DTYP, "WavBuf") # 'signal' number selects 'beam', 'calX', 'calY' field(INP, "#C0 S1") field(NELM, "512") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32768") field(LOPR, "-32767") field(SCAN, "1 second") } record(waveform, "HL2:SBPM:HL36:GRNW") { field(DESC, "Raw CAL GRN Data") field(DTYP, "WavBuf") # 'signal' number selects 'beam', 'calX', 'calY' field(INP, "#C0 S2") field(NELM, "512") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32768") field(LOPR, "-32767") field(SCAN, "1 second") } record(waveform, "HL2:SBPM:HL36:RAWDBG") { field(DESC, "Raw BEAM Dbg") field(DTYP, "WavBuf") # 'signal' number selects 'beam', 'calX', 'calY' # do not 'wbscan' for now since e.g., an underrange # condition on the real signal can happen. field(INP, "#C0 S7") field(NELM, "512") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32768") field(LOPR, "-32767") field(SCAN, "Passive") } record(waveform, "HL2:SBPM:HL36:REDDBG") { field(DESC, "Raw CAL RED Dbg") field(DTYP, "WavBuf") # 'signal' number selects 'beam', 'calX', 'calY' field(INP, "#C0 S8 @wbscan") field(NELM, "512") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32768") field(LOPR, "-32767") field(SCAN, "Passive") } record(waveform, "HL2:SBPM:HL36:GRNDBG") { field(DESC, "Raw CAL GRN Dbg") field(DTYP, "WavBuf") # 'signal' number selects 'beam', 'calX', 'calY' field(INP, "#C0 S9 @wbscan") field(NELM, "512") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32768") field(LOPR, "-32767") field(SCAN, "Passive") } record(ai, "HL2:SBPM:HL36:GRUV") { field(DESC, "CAL Gain GRN/RED") field(DTYP, "Raw Stripl Calp") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C0 S0") field(SCAN, "10 second") field(PREC, "4") field(LOPR, "0.5") field(HOPR, "1.5") } record(ai, "HL2:SBPM:HL36:GRU") { field(DESC, "CAL Gain GRN/BLU") field(DTYP, "Raw Stripl Calp") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C0 S1") field(SCAN, "10 second") field(PREC, "4") field(LOPR, "0.5") field(HOPR, "1.5") info(autosaveFields, "ASLO") } record(ai, "HL2:SBPM:HL36:GRV") { field(DESC, "CAL Gain RED/YLO") field(DTYP, "Raw Stripl Calp") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C0 S2") field(SCAN, "10 second") field(PREC, "4") field(LOPR, "0.5") field(HOPR, "1.5") info(autosaveFields, "ASLO") } record(ai, "HL2:SBPM:HL36:TGRN") { field(DESC, "Green arrival time") field(DTYP, "Raw Bpm Signal") field(EGU, "ADC Clocks") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C0 S4") field(SCAN, "10 second") field(PREC, "1") field(LOPR, "0") field(HOPR, "128") field(LOLO, "5") field(LOW, "8") field(HIGH, "60") field(HIHI, "70") field(LLSV, "MAJOR") field(LSV, "MINOR") field(HSV, "MINOR") field(HHSV, "MAJOR") } record(ai, "HL2:SBPM:HL36:TRED") { field(DESC, "Red arrival time") field(DTYP, "Raw Bpm Signal") field(EGU, "ADC Clocks") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C0 S5") field(SCAN, "10 second") field(PREC, "1") field(LOPR, "0") field(HOPR, "128") field(LOLO, "5") field(LOW, "8") field(HIGH, "60") field(HIHI, "70") field(LLSV, "MAJOR") field(LSV, "MINOR") field(HSV, "MINOR") field(HHSV, "MAJOR") } record(ai, "HL2:SBPM:HL36:TBLU") { field(DESC, "Blue arrival time") field(DTYP, "Raw Bpm Signal") field(EGU, "ADC Clocks") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C0 S6") field(SCAN, "10 second") field(PREC, "1") field(LOPR, "0") field(HOPR, "128") field(LOLO, "5") field(LOW, "8") field(HIGH, "60") field(HIHI, "70") field(LLSV, "MAJOR") field(LSV, "MINOR") field(HSV, "MINOR") field(HHSV, "MAJOR") } record(ai, "HL2:SBPM:HL36:TYLO") { field(DESC, "Yellow arrival time") field(DTYP, "Raw Bpm Signal") field(EGU, "ADC Clocks") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C0 S7") field(SCAN, "10 second") field(PREC, "1") field(LOPR, "0") field(HOPR, "128") field(LOLO, "5") field(LOW, "8") field(HIGH, "60") field(HIHI, "70") field(LLSV, "MAJOR") field(LSV, "MINOR") field(HSV, "MINOR") field(HHSV, "MAJOR") } record(ao, "HL2:SBPM:HL36:PINC_ADJ") { field(DESC, "Adjust Pinc. Corr.") field(DTYP, "Soft Channel") field(OUT, "HL2:SBPM:HL36:CALC.K PP MS") field(VAL, "0") field(DRVL, "0") field(DRVH, "2") field(PINI, "YES") info(autosaveFields, "VAL") } # QSCL setting: # # Q: charge # Z: impedance # F: form factor: phi/(2 pi) sin(2 pi f l/c) # # Signal = Q Z F G h(t) = A h(t) [A] = Vs # # inf inf # Energy = A^2 / h^2(t) dt = A^2 / |H(w)|^2 dw/2/pi = A^2 B # 0 0 # # Measured energy = Sum{ (Vp/32768 * xi)^2 } / fs = S / fs ~ Energy # # -> A^2 B = S/fs # # With T = sqrt( Sum{ xi^2 } ) # # A = sqrt(S)/sqrt(B*fs) = T/sqrt(B*fs) Vp/32768 # # T/32768 Vp # Q = A/F/G/Z = ----------------- # F G Z sqrt(B*fs) # # Vp = { 1.5Vpp/2 (PGA=1) or 2.25Vpp/2 (PGA=0) } / 2 (transformer) # # I believe PGA is off (-> Vp ~ .56V) # # Z = 50 # # G: (calibration uses GRN/BLU -> signal should have the # level of the grn/red channels with the additional switch) # # Block diagram / parts / gain: # # [filt] [Att1] [Amp1] [Att2] [BPF] [Amp2] [pad] [Amp3] [switch] # f-17520 hmc540lp3 SBF-5089 hmc540lp3 MBP-140-6-4 SBF-4089 PAT-0 SBF-4089 HMC-197 # # -2dB* -1dB 20dB -1dB -4.5 14.8dB 0dB 14.8dB -0.4dB # # *: 1st filter ATT is a wild guess. # BPF loss (RLC Catalog, pp.55): (L (nsect+.5) / (% of 3dB BW) + .2) dB # with L ~6.2 10MHz/fc=140Mhz filter-> 4.5 # # -> Gtot ~ 40.7dB # # subtract cable loss (2dB); Gtot = 86 # # T/32768 Vp .56V/32768 # Q = A/F/G/Z = ----------------- = T/F ------------------------ # F G Z sqrt(B*fs) 86*50*sqrt(10*140)Mhz # # = T/F = 1.06E-7/F nC # # F for a 7% coverage, 4" BPM at 140MHz .07 sin(2*pi*140e6 4*.0254/3e8) # = .021 # # => 1.06E-7/.021 nC = 5E-6 nC # # (Faraday cup measurement -> (3600/44)^-1 1e-4 -> 1.22E-6 # record(ao, "HL2:SBPM:HL36:QSCL") { field(DESC, "TMIT/Charge Scale") field(DTYP, "Soft Channel") field(OUT, "HL2:SBPM:HL36:QSCA.A PP MS") # 5.0E-6 / 1.6E-10 [nC/e-] field(VAL, "31250") field(EGU, "Nel") field(PREC, "3") field(PINI, "YES") info(autosaveFields, "VAL") } # Adjust TMIT scale for AFE attenuation record(calcout, "HL2:SBPM:HL36:QSCA") { field(DESC, "TMIT ATT Adj. Scale") field(INPB, "HL2:SBPM:HL36:ATT1 CP") field(INPC, "HL2:SBPM:HL36:ATT2 CP") field(CALC, "A*10^((B+C+D)/20)") # use CA link to deposit into TMIT.ASLO so # that TMIT is not forced into linkset # of this record field(OUT, "HL2:SBPM:HL36:TMIT.ASLO CA") field(EGU, "Nel") field(PREC, "3") info(autosaveFields, "D") } record(ao, "HL2:SBPM:HL36:ATT1SIMP") { field(DESC, "ATT1 Propagator") field(DTYP, "Soft Channel") field(DOL, "HL2:SBPM:HL36:ATT1 CP") field(OMSL, "closed_loop") field(OUT, "HL2:SBPM:HL36:ASIM.A PP") field(IVOA, "Set output to IVOV") field(IVOV, "0") field(EGU, "dB") } record(ao, "HL2:SBPM:HL36:ATT2SIMP") { field(DESC, "ATT2 Propagator") field(DTYP, "Soft Channel") field(DOL, "HL2:SBPM:HL36:ATT2 CP") field(OMSL, "closed_loop") field(OUT, "HL2:SBPM:HL36:ASIM.C PP") field(IVOA, "Set output to IVOV") field(IVOV, "0") field(EGU, "dB") } # Attenuate charge either by # real attenuator settings or # by fake ones. # If B, C >= 0 then their # values will be used instead # of ATT1, ATT2 record(calcout, "HL2:SBPM:HL36:ASIM") { field(DESC, "Q Simul Attenuator") field(DTYP, "Soft Channel") field(OUT, "HL2:SBPM:HL36:QSIM.ESLO PP") # ATT1SIM puts value into A # set to -1 to use real attenuator settings # and >=0 to use B instead field(B, "-1") # ATT2SIM puts value into C # set to -1 to use real attenuator settings # and >=0 to use D instead field(D, "-1") field(CALC, "10^(((B>=0?B:A)+(D>=0?D:C))/20)") field(PINI, "YES") } record(ao, "HL2:SBPM:HL36:WSIM") { field(DESC, "BPM W Simul.") field(DTYP, "Soft Channel") field(OUT, "HL2:SBPM:HL36:SIM.G PP") field(VAL, "0.07") field(EGU, "%") field(PINI, "YES") field(PREC, "3") field(LOPR, "0") field(HOPR, "0.25") } record(sel, "HL2:SBPM:HL36:STA") { field(DESC, "Status Summary") field(SELM, "High Signal") field(INPA, "HL2:SBPM:HL36:RSTA.SEVR MS NPP") field(INPB, "HL2:SBPM:HL36:TMIT.SEVR MS NPP") field(INPC, "HL2:SBPM:HL36:Y.SEVR MS NPP") field(INPD, "HL2:SBPM:HL36:X.SEVR MS NPP") field(INPE, "HL2:SBPM:HL36:TGRN.SEVR MS NPP") field(INPF, "HL2:SBPM:HL36:TRED.SEVR MS NPP") field(INPG, "HL2:SBPM:HL36:TBLU.SEVR MS NPP") field(INPH, "HL2:SBPM:HL36:TYLO.SEVR MS NPP") field(INPI, "HL2:SBPM:HL36:GRU.SEVR MS NPP") field(INPJ, "HL2:SBPM:HL36:GRV.SEVR MS NPP") field(SCAN, "1 second") } # This record really belongs on the # PAD IOC. We keep them here however # so we can save/restore. It is more # confusing but shouldn't matter from # an efficiency standpoint (they are # rarely changed). record(longout, "HL2:SBPM:HL36:ATTO") { field(DESC, "AFE Tot. Att. Offset") # fetched via inlink #field(OUT, "HL2:SBPM:HL36:ATTC.B PP") field(DRVL, "-10") field(DRVH, "30") field(LOPR, "-10") field(HOPR, "30") field(EGU, "dB") field(VAL, "0") field(PINI, "YES") info(autosaveFields, "VAL DRVH HOPR DRVL LOPR") } # This record really belongs on the # PAD IOC. We keep them here however # so we can save/restore. It is more # confusing but shouldn't matter from # an efficiency standpoint (they are # rarely changed). record(longout, "HL2:SBPM:HL36:CLAO") { field(DESC, "AFE Cal. Att. Offset") # fetched via inlink #field(OUT, "HL2:SBPM:HL36:ATTC.C PP") field(DRVL, "-20") field(DRVH, "20") field(LOPR, "-20") field(HOPR, "20") field(EGU, "dB") field(VAL, "40") field(PINI, "YES") info(autosaveFields, "VAL DRVH HOPR DRVL LOPR") } record(calc, "HL2:SBPM:HL36:STA_ALH") { field(DESC, "Status Summary") field(SCAN, "1 second") field(CALC, "0") field(INPA, "HL2:SBPM:HL36:RSTA_ALH.SEVR MS NPP") field(INPB, "HL2:SBPM:HL36:GRU.SEVR MS NPP") field(INPC, "HL2:SBPM:HL36:GRV.SEVR MS NPP") field(INPD, "HL2:SBPM:HL36:CHK.SEVR MS NPP") field(INPE, "") field(INPF, "HL2:SBPM:HL36:AFE_COMM.SEVR MS NPP") } # snapshot PV for the bpm values display record(ai, "HL2:SBPM:HL36:GRN_SLOW") { field(DESC, "GRN snapshot for display") field(INP, "HL2:SBPM:HL36:GRN NPP MS") field(EGU, "raw") field(SCAN, "1 second") field(FLNK, "HL2:SBPM:HL36:RED_SLOW") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(ai, "HL2:SBPM:HL36:RED_SLOW") { field(DESC, "RED snapshot for display") # 'card' selects PAD number, 'signal' selects strip field(INP, "HL2:SBPM:HL36:RED NPP MS") field(EGU, "raw") field(SCAN, "Passive") field(FLNK, "HL2:SBPM:HL36:BLU_SLOW") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(ai, "HL2:SBPM:HL36:BLU_SLOW") { field(DESC, "BLU snapshot for display") # 'card' selects PAD number, 'signal' selects strip field(INP, "HL2:SBPM:HL36:BLU NPP MS") field(EGU, "raw") field(SCAN, "Passive") field(FLNK, "HL2:SBPM:HL36:YLO_SLOW") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(ai, "HL2:SBPM:HL36:YLO_SLOW") { field(DESC, "YLO snapshot for display") field(INP, "HL2:SBPM:HL36:YLO NPP MS") field(EGU, "raw") field(SCAN, "Passive") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(sub, "HL2:SBPM:HL36:CALC") { field(SNAM, "drvBpmBvectSetupSub") # E: phi F: psi # BPM channel number in L field(INPL, "0") field(SCAN, "Passive") } record(bo, "HL2:SBPM:HL36:PINC_ENA") { field(DESC, "Simple Pincushion Alg") field(DTYP, "BusAddress") field(OUT, "#C0S2@drvBpmStriplPincEna,m32") field(MASK, "1") field(ZNAM, "DISABLED") field(ONAM, "ENABLED") field(VAL, "0") field(PINI, "YES") info(autosaveFields, "VAL") } record(ao, "HL2:SBPM:HL36:UDR_THRES") { field(DESC, "Detection Underrange Threshold") field(DTYP, "Bpm Parameters") field(OUT, "#C0S0") field(EGU, "ADC Ticks") field(DOL, "45.26") field(PINI, "YES") field(DRVL, "0") field(DRVH, "32767") info(autosaveFields, "VAL") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBDEND # per BPM database for stripline BPMs ###################################### # HEAD of main processing chain ###################################### record(ai, "HL2:SBPM:HL36:X") { field(DESC, "X Position") field(EGU, "mm") field(DTYP, "Raw Bpm Signal") field(INP, "#C0 S11") field(SCAN, "I/O Intr") # The priority determines what scan list we are being # put on (see drvPadUdpComm.c) field(PRIO, "HIGH") field(FLNK, "HL2:SBPM:HL36:Y") field(PREC, "4") field(LOPR, "-12") field(HOPR, "+12") field(ASG, "") field(TSE, "-2") info(autosaveFields, "ASLO LOLO LOW HIGH HIHI HHSV LLSV") } record(ai, "HL2:SBPM:HL36:Y") { field(DESC, "Y Position") field(EGU, "mm") field(DTYP, "Raw Bpm Signal") field(INP, "#C0 S12") field(FLNK, "HL2:SBPM:HL36:TMIT") field(PREC, "4") field(LOPR, "-12") field(HOPR, "+12") field(ASG, "") field(TSE, "-2") info(autosaveFields, "ASLO LOLO LOW HIGH HIHI HHSV LLSV") } record(ai, "HL2:SBPM:HL36:TMIT") { field(DESC, "Charge Estimate") field(DTYP, "Raw Bpm Signal") field(INP, "#C0 S13") field(EGU, "Nel") field(PREC, "3") field(LOPR, "0") field(HOPR, "1E11") # FLINK into BSA field(FLNK, "HL2:SBPM:HL36:EFX.PROC") field(ASG, "") field(TSE, "-2") info(autosaveFields, "LOLO LOW HIGH HIHI HHSV LLSV ") } ###################################### # HEAD of diagnostics processing chain ###################################### # leave RWAV in it's own lockset; don't FLNK # to 'U' & friends record(waveform, "HL2:SBPM:HL36:RWAV") { field(DESC, "Raw BPM Data") field(DTYP, "WavBuf") # 'signal' number selects 'beam', 'calX', 'calY' field(INP, "#C0 S0") field(SCAN, "I/O Intr") # use LOW or HIGH to end up on the 'diagnostic' # scan list (see drvPadUdpComm.c) field(PRIO, "LOW") field(NELM, "512") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32768") field(LOPR, "-32767") } record(ai, "HL2:SBPM:HL36:U") { field(DESC, "Raw U Position") field(DTYP, "Raw Bpm Signal") field(INP, "#C0 S8") field(SCAN, "I/O Intr") # use LOW or HIGH to end up on the 'diagnostic' # scan list (see drvPadUdpComm.c) field(PRIO, "LOW") field(PREC, "5") field(EGU, "mm") field(LOPR, "-0.7") field(HOPR, "+0.7") field(FLNK, "HL2:SBPM:HL36:V") } record(ai, "HL2:SBPM:HL36:V") { field(DESC, "Raw V Position") field(DTYP, "Raw Bpm Signal") field(INP, "#C0 S9") field(SCAN, "Passive") field(PREC, "5") field(EGU, "mm") field(LOPR, "-0.7") field(HOPR, "+0.7") field(FLNK, "HL2:SBPM:HL36:PINC") } record(ai, "HL2:SBPM:HL36:PINC") { field(DESC, "Pin Cushion Corr.") field(DTYP, "Raw Bpm Signal") field(INP, "#C0 S10") field(SCAN, "Passive") } record(longin, "HL2:SBPM:HL36:RSTA") { field(DESC, "Status of Raw Processor") field(DTYP, "Bpm Raw Status") field(INP, "#C0S0") field(SCAN, "1 second") field(LOLO, "-1") field(HIHI, "+1") field(HHSV, "INVALID") field(LLSV, "INVALID") field(FLNK, "HL2:SBPM:HL36:RSTA_ALH") } record(calc, "HL2:SBPM:HL36:RSTA_ALH") { field(CALC, "A & B") field(INPA, "HL2:SBPM:HL36:RSTA") field(INPB, "0x30F") field(HIHI, "1") field(LOLO, "-1") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(SCAN, "Passive") } ###################################### # Input/Parameteres ###################################### record(ao, "HL2:SBPM:HL36:PHI") { field(DESC, "Rot Angle") field(DTYP, "Soft Channel") field(VAL, "0") field(EGU, "deg") field(PREC, "1") field(LOPR, "-180") field(HOPR, "+180") field(FLNK, "HL2:SBPM:HL36:PHI_SEQ") } record(ao, "HL2:SBPM:HL36:PSI") { field(DESC, "Axis Sep. Angle") field(DTYP, "Soft Channel") field(VAL, "90") field(EGU, "deg") field(PREC, "1") field(LOPR, "0") field(HOPR, "+180") field(FLNK, "HL2:SBPM:HL36:PSI_SEQ") } #record(dfanout, "HL2:SBPM:HL36:PCMM") { # field(DESC, "BPM Scale") # field(OUTA, "HL2:SBPM:HL36:USCL PP MS") # field(OUTB, "HL2:SBPM:HL36:VSCL PP MS") # field(VAL, "12") # field(EGU, "mm") # field(PREC, "4") # field(LOPR, "5") # field(HOPR, "15") # field(PINI, "YES") #} record(ao, "HL2:SBPM:HL36:UOFF") { field(DESC, "BPM U Offset") field(DTYP, "Soft Channel") field(VAL, "0") field(EGU, "mm") field(PREC, "4") field(LOPR, "-5") field(HOPR, "+5") field(FLNK, "HL2:SBPM:HL36:UOFF_SEQ") } record(ao, "HL2:SBPM:HL36:VOFF") { field(DESC, "BPM V Offset") field(DTYP, "Soft Channel") field(VAL, "0") field(EGU, "mm") field(PREC, "4") field(LOPR, "-5") field(HOPR, "+5") field(FLNK, "HL2:SBPM:HL36:VOFF_SEQ") } record(ao, "HL2:SBPM:HL36:USCL") { field(DESC, "BPM U Scale") field(DTYP, "Soft Channel") field(VAL, "1") field(EGU, "mm") field(PREC, "4") field(FLNK, "HL2:SBPM:HL36:USCL_SEQ") } record(ao, "HL2:SBPM:HL36:VSCL") { field(DESC, "BPM V Scale") field(DTYP, "Soft Channel") field(VAL, "1") field(EGU, "mm") field(PREC, "4") field(FLNK, "HL2:SBPM:HL36:VSCL_SEQ") } record(mbbo, "HL2:SBPM:HL36:ACCESS") { field(DESC, "BPM On Line") field(DTYP, "StreamSwitch") field(OUT, "#C0 S0") field(ZRVL, "1") field(ZRST, "Running") field(ZRSV, "NO_ALARM") field(ONVL, "1") field(ONST, "Maintenance") field(ONSV, "MINOR") field(TWVL, "1") field(TWST, "Test") field(TWSV, "MINOR") field(THVL, "0") field(THST, "OFFLINE") field(THSV, "MAJOR") # set both, rval and val to get it right # regardless of whether devsup does conversion # or not. field(RVAL, "0") field(VAL, "0") field(PINI, "YES") field(FLNK, "HL2:SBPM:HL36:SIMOFF") info(autosaveFields, "RVAL") } # # 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, "HL2:SBPM:HL36:FBCK") { field(DESC, "Feedback State") field(PINI, "YES") field(OMSL, "supervisory") field(VAL, "0") field(ZRVL, "0") field(ONVL, "1") field(TWVL, "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") info(autosaveFields, "VAL") } # Convenience record holding the MAD name record(stringin, "HL2:SBPM:HL36:MADN") { field(DESC, "MAD Name") field(VAL, "SBPMHL36") field(PINI, "YES") } record(stringin, "SBPMHL36:NAME") { field(DESC, "BPM Name") field(VAL, "HL2:SBPM:HL36") field(PINI, "YES") } record(ai, "HL2:SBPM:HL36:X_SLOW") { #alias("HL2:SBPM:HL36:X1H") field(DESC, "X snapshot for display") field(EGU, "mm") field(INP, "HL2:SBPM:HL36:X MS") field(FLNK, "HL2:SBPM:HL36:Y_SLOW") field(PREC, "4") field(SCAN, "1 second") field(LOPR, "-12") field(HOPR, "+12") } record(ai, "HL2:SBPM:HL36:Y_SLOW") { #alias("HL2:SBPM:HL36:Y1H") field(DESC, "Y snapshot for display") field(EGU, "mm") field(INP, "HL2:SBPM:HL36:Y NPP MS") field(FLNK, "HL2:SBPM:HL36:TMIT_SLOW") field(PREC, "4") field(LOPR, "-12") field(HOPR, "+12") } record(ai, "HL2:SBPM:HL36:TMIT_SLOW") { #alias("HL2:SBPM:HL36:TMIT1H") field(DESC, "TMIT snapshot for display") field(INP, "HL2:SBPM:HL36:TMIT NPP MS") field(EGU, "Nel") field(PREC, "3") field(LOPR, "0") field(HOPR, "1E11") } ###################################### # Simulation Parameters + Control ###################################### # switch off simulation when going off-line record(calcout, "HL2:SBPM:HL36:SIMOFF") { field(DESC, "Sim Off Propagator") field(INPA, "HL2:SBPM:HL36:ACCESS.RVAL") field(CALC, "A") field(OCAL, "0") field(OOPT, "When Zero") field(DOPT, "Use OCAL") field(OUT, "HL2:SBPM:HL36:SIMC PP") } record(calcout, "HL2:SBPM:HL36:SIM") { field(DESC, "BPM Pos. Simulation") field(DTYP, "Strip Signal Simulator") field(OUT, "0") #CALC & VAL unused; the real calculation is done # in device support. The reason this is a # calcout rather than sub is that we want # to use the OUT link... field(CALC, "A") field(INPA, "HL2:SBPM:HL36:USCL") field(INPL, "0") } # Switch simulation record HL2:SBPM:HL36:SIMCSEQ moved to # bpmCavity.db.part and bpmStripl.db.part record(mbbo, "HL2:SBPM:HL36:SIMC") { field(DESC, "Stripl Sim Ctl") field(DTYP, "Raw Soft Channel") field(OUT, "HL2:SBPM:HL36:SIMCSEQ.SELN PP") field(ZRST, "OFF") field(ZRVL, "0x0f") field(ONST, "ON") field(ONVL, "0x1c0") field(TWST, "SOFT") field(TWVL, "0x030") field(MASK, "-1") field(NOBT, "16") field(VAL, "0") field(RVAL, "0x0f") field(PINI, "YES") } record(ao, "HL2:SBPM:HL36:XSIM") { field(DESC, "BPM X Pos. Simul.") field(DTYP, "Soft Channel") field(OUT, "HL2:SBPM:HL36:SIM.B PP") field(VAL, "0.5") field(EGU, "mm") field(PINI, "YES") field(PREC, "4") field(LOPR, "-12") field(HOPR, "+12") } record(ao, "HL2:SBPM:HL36:YSIM") { field(DESC, "BPM Y Pos. Simul.") field(DTYP, "Soft Channel") field(OUT, "HL2:SBPM:HL36:SIM.C PP") field(VAL, "0.") field(EGU, "mm") field(PINI, "YES") field(PREC, "4") field(LOPR, "-12") field(HOPR, "+12") } record(ao, "HL2:SBPM:HL36:QSIM") { field(DESC, "BPM Q Simul.") field(DTYP, "Raw Soft Channel") field(OUT, "HL2:SBPM:HL36:SIM.D PP") field(EGU, "Nel") field(ASLO, "6000") #ESLO is used to add attenuation field(LINR, "LINEAR") field(VAL, "1E9") field(PINI, "YES") field(PREC, "4") field(LOPR, "0") field(HOPR, "1E11") } record(ao, "HL2:SBPM:HL36:ROTS") { field(DESC, "BPM Rot. Simul.") field(DTYP, "Soft Channel") field(OUT, "HL2:SBPM:HL36:SIM.E PP") field(VAL, "0.") field(EGU, "deg") field(PINI, "YES") field(PREC, "1") field(LOPR, "-180") } record(ao, "HL2:SBPM:HL36:PSIS") { field(DESC, "BPM Angle. Simul.") field(DTYP, "Soft Channel") field(OUT, "HL2:SBPM:HL36:SIM.F PP") field(VAL, "90") field(EGU, "deg") field(PINI, "YES") field(PREC, "1") field(LOPR, "0") } record(aao, "HL2:SBPM:HL36:DIGISIMW") { field(DESC, "VME Digi Sim. Waveform") field(DTYP, "VmeDigi Sim Wav") field(OUT, "#C0 S0") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32678") field(LOPR, "-32768") # 16384 samples/channel * 4 channels field(NELM, "65536") field(PINI, "NO") } #Used by model/database folks to verify BPM record(ao, "HL2:SBPM:HL36:Z") { field(DESC, "Z Position") field(PINI, "YES") info(autosaveFields, "VAL") } # MPS interface record(bo, "HL2:SBPM:HL36:MPSBYP") { field(DESC, "MPS Bypass") field(DTYP, "BusAddress") field(OUT, "#C0S2@bpmMPS+0,m32") field(MASK, "1") field(ZNAM, "BYPASSED") field(ONAM, "NOT_BYPASSED") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(VAL, "0") field(PINI, "YES") field(ASG, "") info(autosaveFields, "VAL") } record(bo, "HL2:SBPM:HL36:MPSLTBYP") { field(DESC, "MPS Bypass") field(DTYP, "BusAddress") field(OUT, "#C1S2@bpmMPS+0,m32") field(MASK, "1") field(ZNAM, "BYPASSED") field(ONAM, "NOT_BYPASSED") field(ZSV, "NO_ALARM") field(OSV, "NO_ALARM") field(VAL, "0") field(PINI, "YES") field(ASG, "") info(autosaveFields, "VAL") } record(calc, "HL2:SBPM:HL36:MPSIGNRCALC") { field(DESC, "MPS ignore if TMIT too low") field(CALC, "A $[parm]_SEQ # # Different values of the parameter # $[parm0]..$[parm9] are stored in # $[parm]_SEL.A .. $[parm]_SEL.J # # The actual value of the parameter is # selected based on the value of a controlling # PV $[ctrl] using a 'mapping' CALC expression # $[mapc] to convert the $[ctrl] value into # the integer range 1..10. # # The selected value of $[parm] is written # to output link $[outl] # # A) When the user writes $[parm] then # its value is deposited in the currently # selected field of $[parm]_SEL and # propagated to $[outl] # # B) When the user writes any of $[parm]_SEL.A..J # then the value is stored there. If she # writes to the currently 'active' field\ # (as selected by $[ctrl]) then # the $[parm] PV itself is updated and the # value is also propagated to $[outl] # # C) If the user changes $[ctrl] then the # corresponding value $[parm]_SEL.A..J is # propagated to $[outl] and $[parm]. # # D) At initialization, the value corresponding # to the initial setting of $[ctrl] is written # to $[outl] and $[parm] # # MACROS: # # $[parm] PV holding the parameter # $[ctrl] PV that controls the selection of # the currently active setting of # $[parm] # $[outl] PV where the currently selected # value of $[parm] shall be written-to # (if applicable) # $[prec] Precision of the $[parm]_SEL variable # (should be set to same value as $[parm].PREC) # # $[parm0]..$[parm9] initial values of $[parm] # # $[mapc] CALC expression to convert the value # of the controlling PV which is available # as 'A' to the range 1..10 (or less if # less selections are used). # E.g., to convert the value of a bo (0/1) # you would set mapc to 'A+1' (0..1 -> 1..2) # # NOTE: This sb snippet is loaded/expanded # for every parameter under control # of $[ctrl]. ALSO, the companion # snippet parmCtl.db must be loaded/expanded # but only once per controlling PV. # # This record, when scanned (as a result # of $[parm] being written and processing # its FLNK to this record] fetches $[parm] # and deposits the value into the currently # selected field of the SEL record. # # NOTE: unfortunately, the selection # mechanism of the SEQ and SEL # records differs: SEQ is 1-based, # SEL is 0-based -- now that makes # sense, doesn't it? # record(seq, "HL2:SBPM:HL36:UOFF_SEQ") { field(DESC, "Propagate Parm -> SEL") field(DOL1, "HL2:SBPM:HL36:UOFF") field(DOL2, "HL2:SBPM:HL36:UOFF") field(DOL3, "HL2:SBPM:HL36:UOFF") field(DOL4, "HL2:SBPM:HL36:UOFF") field(DOL5, "HL2:SBPM:HL36:UOFF") field(DOL6, "HL2:SBPM:HL36:UOFF") field(DOL7, "HL2:SBPM:HL36:UOFF") field(DOL8, "HL2:SBPM:HL36:UOFF") field(DOL9, "HL2:SBPM:HL36:UOFF") field(DOLA, "HL2:SBPM:HL36:UOFF") field(LNK1, "HL2:SBPM:HL36:UOFF_SEL.A PP") field(LNK2, "HL2:SBPM:HL36:UOFF_SEL.B PP") field(LNK3, "HL2:SBPM:HL36:UOFF_SEL.C PP") field(LNK4, "HL2:SBPM:HL36:UOFF_SEL.D PP") field(LNK5, "HL2:SBPM:HL36:UOFF_SEL.E PP") field(LNK6, "HL2:SBPM:HL36:UOFF_SEL.F PP") field(LNK7, "HL2:SBPM:HL36:UOFF_SEL.G PP") field(LNK8, "HL2:SBPM:HL36:UOFF_SEL.H PP") field(LNK9, "HL2:SBPM:HL36:UOFF_SEL.I PP") field(LNKA, "HL2:SBPM:HL36:UOFF_SEL.J PP") field(SELM, "Specified") field(SELL, "HL2:SBPM:HL36:UOFF_CTRL NPP NMS") } # The $[parm]_SEL record holds all possible # values of $[parm] in the 'A..J' fields. # # When processed it updates it's own VAL # to the currently selected input. Input # 'L' serves as the (1-based) selector, # i.e., L==1 selects 'A'->'VAL'. # # When the selected value changes (as a # result of SEQ depositing a new value OR # $[ctrl] changing and updating L) then # the propagator record attached to the # FLNK is processed. # record(sub, "HL2:SBPM:HL36:UOFF_SEL") { # field(INAM, "parmSelSubInit") field(SNAM, "parmSelSubProc") field(A, "0") field(B, "0") field(C, "") field(D, "") field(E, "") field(F, "") field(G, "") field(H, "") field(I, "") field(J, "") field(PREC, "4") field(FLNK, "HL2:SBPM:HL36:UOFF_PROP") info(autosaveFields, "A B C D E F G H I J") } # # Finally the dfanout record # fetches the currently selected # value from SEL and propagates it # to $[outl]. It also updates # $[parm] itself so that $[parm] # always reflects the currently # selected value. # record(dfanout, "HL2:SBPM:HL36:UOFF_PROP") { field(OMSL, "closed_loop") field(DOL, "HL2:SBPM:HL36:UOFF_SEL") field(OUTA, "HL2:SBPM:HL36:U.AOFF CA") field(OUTB, "HL2:SBPM:HL36:UOFF PP") } # Drive the SEL record when the 'ctrl' PV changes # Use a CA link to monitor such changes record(calcout, "HL2:SBPM:HL36:UOFF_CTRL") { field(INPA, "HL2:SBPM:HL36:PARMSEL CP") field(CALC, "A+1") field(DOPT, "Use CALC") field(OOPT, "On Change") field(OUT, "HL2:SBPM:HL36:UOFF_SEL.L PP") } # Maintain multiple (up to 10) values of # a parameter: # # Record holding the parameter $[parm] # must FLNK -> $[parm]_SEQ # # Different values of the parameter # $[parm0]..$[parm9] are stored in # $[parm]_SEL.A .. $[parm]_SEL.J # # The actual value of the parameter is # selected based on the value of a controlling # PV $[ctrl] using a 'mapping' CALC expression # $[mapc] to convert the $[ctrl] value into # the integer range 1..10. # # The selected value of $[parm] is written # to output link $[outl] # # A) When the user writes $[parm] then # its value is deposited in the currently # selected field of $[parm]_SEL and # propagated to $[outl] # # B) When the user writes any of $[parm]_SEL.A..J # then the value is stored there. If she # writes to the currently 'active' field\ # (as selected by $[ctrl]) then # the $[parm] PV itself is updated and the # value is also propagated to $[outl] # # C) If the user changes $[ctrl] then the # corresponding value $[parm]_SEL.A..J is # propagated to $[outl] and $[parm]. # # D) At initialization, the value corresponding # to the initial setting of $[ctrl] is written # to $[outl] and $[parm] # # MACROS: # # $[parm] PV holding the parameter # $[ctrl] PV that controls the selection of # the currently active setting of # $[parm] # $[outl] PV where the currently selected # value of $[parm] shall be written-to # (if applicable) # $[prec] Precision of the $[parm]_SEL variable # (should be set to same value as $[parm].PREC) # # $[parm0]..$[parm9] initial values of $[parm] # # $[mapc] CALC expression to convert the value # of the controlling PV which is available # as 'A' to the range 1..10 (or less if # less selections are used). # E.g., to convert the value of a bo (0/1) # you would set mapc to 'A+1' (0..1 -> 1..2) # # NOTE: This sb snippet is loaded/expanded # for every parameter under control # of $[ctrl]. ALSO, the companion # snippet parmCtl.db must be loaded/expanded # but only once per controlling PV. # # This record, when scanned (as a result # of $[parm] being written and processing # its FLNK to this record] fetches $[parm] # and deposits the value into the currently # selected field of the SEL record. # # NOTE: unfortunately, the selection # mechanism of the SEQ and SEL # records differs: SEQ is 1-based, # SEL is 0-based -- now that makes # sense, doesn't it? # record(seq, "HL2:SBPM:HL36:VOFF_SEQ") { field(DESC, "Propagate Parm -> SEL") field(DOL1, "HL2:SBPM:HL36:VOFF") field(DOL2, "HL2:SBPM:HL36:VOFF") field(DOL3, "HL2:SBPM:HL36:VOFF") field(DOL4, "HL2:SBPM:HL36:VOFF") field(DOL5, "HL2:SBPM:HL36:VOFF") field(DOL6, "HL2:SBPM:HL36:VOFF") field(DOL7, "HL2:SBPM:HL36:VOFF") field(DOL8, "HL2:SBPM:HL36:VOFF") field(DOL9, "HL2:SBPM:HL36:VOFF") field(DOLA, "HL2:SBPM:HL36:VOFF") field(LNK1, "HL2:SBPM:HL36:VOFF_SEL.A PP") field(LNK2, "HL2:SBPM:HL36:VOFF_SEL.B PP") field(LNK3, "HL2:SBPM:HL36:VOFF_SEL.C PP") field(LNK4, "HL2:SBPM:HL36:VOFF_SEL.D PP") field(LNK5, "HL2:SBPM:HL36:VOFF_SEL.E PP") field(LNK6, "HL2:SBPM:HL36:VOFF_SEL.F PP") field(LNK7, "HL2:SBPM:HL36:VOFF_SEL.G PP") field(LNK8, "HL2:SBPM:HL36:VOFF_SEL.H PP") field(LNK9, "HL2:SBPM:HL36:VOFF_SEL.I PP") field(LNKA, "HL2:SBPM:HL36:VOFF_SEL.J PP") field(SELM, "Specified") field(SELL, "HL2:SBPM:HL36:VOFF_CTRL NPP NMS") } # The $[parm]_SEL record holds all possible # values of $[parm] in the 'A..J' fields. # # When processed it updates it's own VAL # to the currently selected input. Input # 'L' serves as the (1-based) selector, # i.e., L==1 selects 'A'->'VAL'. # # When the selected value changes (as a # result of SEQ depositing a new value OR # $[ctrl] changing and updating L) then # the propagator record attached to the # FLNK is processed. # record(sub, "HL2:SBPM:HL36:VOFF_SEL") { # field(INAM, "parmSelSubInit") field(SNAM, "parmSelSubProc") field(A, "0") field(B, "0") field(C, "") field(D, "") field(E, "") field(F, "") field(G, "") field(H, "") field(I, "") field(J, "") field(PREC, "4") field(FLNK, "HL2:SBPM:HL36:VOFF_PROP") info(autosaveFields, "A B C D E F G H I J") } # # Finally the dfanout record # fetches the currently selected # value from SEL and propagates it # to $[outl]. It also updates # $[parm] itself so that $[parm] # always reflects the currently # selected value. # record(dfanout, "HL2:SBPM:HL36:VOFF_PROP") { field(OMSL, "closed_loop") field(DOL, "HL2:SBPM:HL36:VOFF_SEL") field(OUTA, "HL2:SBPM:HL36:V.AOFF CA") field(OUTB, "HL2:SBPM:HL36:VOFF PP") } # Drive the SEL record when the 'ctrl' PV changes # Use a CA link to monitor such changes record(calcout, "HL2:SBPM:HL36:VOFF_CTRL") { field(INPA, "HL2:SBPM:HL36:PARMSEL CP") field(CALC, "A+1") field(DOPT, "Use CALC") field(OOPT, "On Change") field(OUT, "HL2:SBPM:HL36:VOFF_SEL.L PP") } # Maintain multiple (up to 10) values of # a parameter: # # Record holding the parameter $[parm] # must FLNK -> $[parm]_SEQ # # Different values of the parameter # $[parm0]..$[parm9] are stored in # $[parm]_SEL.A .. $[parm]_SEL.J # # The actual value of the parameter is # selected based on the value of a controlling # PV $[ctrl] using a 'mapping' CALC expression # $[mapc] to convert the $[ctrl] value into # the integer range 1..10. # # The selected value of $[parm] is written # to output link $[outl] # # A) When the user writes $[parm] then # its value is deposited in the currently # selected field of $[parm]_SEL and # propagated to $[outl] # # B) When the user writes any of $[parm]_SEL.A..J # then the value is stored there. If she # writes to the currently 'active' field\ # (as selected by $[ctrl]) then # the $[parm] PV itself is updated and the # value is also propagated to $[outl] # # C) If the user changes $[ctrl] then the # corresponding value $[parm]_SEL.A..J is # propagated to $[outl] and $[parm]. # # D) At initialization, the value corresponding # to the initial setting of $[ctrl] is written # to $[outl] and $[parm] # # MACROS: # # $[parm] PV holding the parameter # $[ctrl] PV that controls the selection of # the currently active setting of # $[parm] # $[outl] PV where the currently selected # value of $[parm] shall be written-to # (if applicable) # $[prec] Precision of the $[parm]_SEL variable # (should be set to same value as $[parm].PREC) # # $[parm0]..$[parm9] initial values of $[parm] # # $[mapc] CALC expression to convert the value # of the controlling PV which is available # as 'A' to the range 1..10 (or less if # less selections are used). # E.g., to convert the value of a bo (0/1) # you would set mapc to 'A+1' (0..1 -> 1..2) # # NOTE: This sb snippet is loaded/expanded # for every parameter under control # of $[ctrl]. ALSO, the companion # snippet parmCtl.db must be loaded/expanded # but only once per controlling PV. # # This record, when scanned (as a result # of $[parm] being written and processing # its FLNK to this record] fetches $[parm] # and deposits the value into the currently # selected field of the SEL record. # # NOTE: unfortunately, the selection # mechanism of the SEQ and SEL # records differs: SEQ is 1-based, # SEL is 0-based -- now that makes # sense, doesn't it? # record(seq, "HL2:SBPM:HL36:USCL_SEQ") { field(DESC, "Propagate Parm -> SEL") field(DOL1, "HL2:SBPM:HL36:USCL") field(DOL2, "HL2:SBPM:HL36:USCL") field(DOL3, "HL2:SBPM:HL36:USCL") field(DOL4, "HL2:SBPM:HL36:USCL") field(DOL5, "HL2:SBPM:HL36:USCL") field(DOL6, "HL2:SBPM:HL36:USCL") field(DOL7, "HL2:SBPM:HL36:USCL") field(DOL8, "HL2:SBPM:HL36:USCL") field(DOL9, "HL2:SBPM:HL36:USCL") field(DOLA, "HL2:SBPM:HL36:USCL") field(LNK1, "HL2:SBPM:HL36:USCL_SEL.A PP") field(LNK2, "HL2:SBPM:HL36:USCL_SEL.B PP") field(LNK3, "HL2:SBPM:HL36:USCL_SEL.C PP") field(LNK4, "HL2:SBPM:HL36:USCL_SEL.D PP") field(LNK5, "HL2:SBPM:HL36:USCL_SEL.E PP") field(LNK6, "HL2:SBPM:HL36:USCL_SEL.F PP") field(LNK7, "HL2:SBPM:HL36:USCL_SEL.G PP") field(LNK8, "HL2:SBPM:HL36:USCL_SEL.H PP") field(LNK9, "HL2:SBPM:HL36:USCL_SEL.I PP") field(LNKA, "HL2:SBPM:HL36:USCL_SEL.J PP") field(SELM, "Specified") field(SELL, "HL2:SBPM:HL36:USCL_CTRL NPP NMS") } # The $[parm]_SEL record holds all possible # values of $[parm] in the 'A..J' fields. # # When processed it updates it's own VAL # to the currently selected input. Input # 'L' serves as the (1-based) selector, # i.e., L==1 selects 'A'->'VAL'. # # When the selected value changes (as a # result of SEQ depositing a new value OR # $[ctrl] changing and updating L) then # the propagator record attached to the # FLNK is processed. # record(sub, "HL2:SBPM:HL36:USCL_SEL") { # field(INAM, "parmSelSubInit") field(SNAM, "parmSelSubProc") field(A, "1") field(B, "1") field(C, "") field(D, "") field(E, "") field(F, "") field(G, "") field(H, "") field(I, "") field(J, "") field(PREC, "4") field(FLNK, "HL2:SBPM:HL36:USCL_PROP") info(autosaveFields, "A B C D E F G H I J") } # # Finally the dfanout record # fetches the currently selected # value from SEL and propagates it # to $[outl]. It also updates # $[parm] itself so that $[parm] # always reflects the currently # selected value. # record(dfanout, "HL2:SBPM:HL36:USCL_PROP") { field(OMSL, "closed_loop") field(DOL, "HL2:SBPM:HL36:USCL_SEL") field(OUTA, "HL2:SBPM:HL36:U.ASLO CA") field(OUTB, "HL2:SBPM:HL36:USCL PP") } # Drive the SEL record when the 'ctrl' PV changes # Use a CA link to monitor such changes record(calcout, "HL2:SBPM:HL36:USCL_CTRL") { field(INPA, "HL2:SBPM:HL36:PARMSEL CP") field(CALC, "A+1") field(DOPT, "Use CALC") field(OOPT, "On Change") field(OUT, "HL2:SBPM:HL36:USCL_SEL.L PP") } # Maintain multiple (up to 10) values of # a parameter: # # Record holding the parameter $[parm] # must FLNK -> $[parm]_SEQ # # Different values of the parameter # $[parm0]..$[parm9] are stored in # $[parm]_SEL.A .. $[parm]_SEL.J # # The actual value of the parameter is # selected based on the value of a controlling # PV $[ctrl] using a 'mapping' CALC expression # $[mapc] to convert the $[ctrl] value into # the integer range 1..10. # # The selected value of $[parm] is written # to output link $[outl] # # A) When the user writes $[parm] then # its value is deposited in the currently # selected field of $[parm]_SEL and # propagated to $[outl] # # B) When the user writes any of $[parm]_SEL.A..J # then the value is stored there. If she # writes to the currently 'active' field\ # (as selected by $[ctrl]) then # the $[parm] PV itself is updated and the # value is also propagated to $[outl] # # C) If the user changes $[ctrl] then the # corresponding value $[parm]_SEL.A..J is # propagated to $[outl] and $[parm]. # # D) At initialization, the value corresponding # to the initial setting of $[ctrl] is written # to $[outl] and $[parm] # # MACROS: # # $[parm] PV holding the parameter # $[ctrl] PV that controls the selection of # the currently active setting of # $[parm] # $[outl] PV where the currently selected # value of $[parm] shall be written-to # (if applicable) # $[prec] Precision of the $[parm]_SEL variable # (should be set to same value as $[parm].PREC) # # $[parm0]..$[parm9] initial values of $[parm] # # $[mapc] CALC expression to convert the value # of the controlling PV which is available # as 'A' to the range 1..10 (or less if # less selections are used). # E.g., to convert the value of a bo (0/1) # you would set mapc to 'A+1' (0..1 -> 1..2) # # NOTE: This sb snippet is loaded/expanded # for every parameter under control # of $[ctrl]. ALSO, the companion # snippet parmCtl.db must be loaded/expanded # but only once per controlling PV. # # This record, when scanned (as a result # of $[parm] being written and processing # its FLNK to this record] fetches $[parm] # and deposits the value into the currently # selected field of the SEL record. # # NOTE: unfortunately, the selection # mechanism of the SEQ and SEL # records differs: SEQ is 1-based, # SEL is 0-based -- now that makes # sense, doesn't it? # record(seq, "HL2:SBPM:HL36:VSCL_SEQ") { field(DESC, "Propagate Parm -> SEL") field(DOL1, "HL2:SBPM:HL36:VSCL") field(DOL2, "HL2:SBPM:HL36:VSCL") field(DOL3, "HL2:SBPM:HL36:VSCL") field(DOL4, "HL2:SBPM:HL36:VSCL") field(DOL5, "HL2:SBPM:HL36:VSCL") field(DOL6, "HL2:SBPM:HL36:VSCL") field(DOL7, "HL2:SBPM:HL36:VSCL") field(DOL8, "HL2:SBPM:HL36:VSCL") field(DOL9, "HL2:SBPM:HL36:VSCL") field(DOLA, "HL2:SBPM:HL36:VSCL") field(LNK1, "HL2:SBPM:HL36:VSCL_SEL.A PP") field(LNK2, "HL2:SBPM:HL36:VSCL_SEL.B PP") field(LNK3, "HL2:SBPM:HL36:VSCL_SEL.C PP") field(LNK4, "HL2:SBPM:HL36:VSCL_SEL.D PP") field(LNK5, "HL2:SBPM:HL36:VSCL_SEL.E PP") field(LNK6, "HL2:SBPM:HL36:VSCL_SEL.F PP") field(LNK7, "HL2:SBPM:HL36:VSCL_SEL.G PP") field(LNK8, "HL2:SBPM:HL36:VSCL_SEL.H PP") field(LNK9, "HL2:SBPM:HL36:VSCL_SEL.I PP") field(LNKA, "HL2:SBPM:HL36:VSCL_SEL.J PP") field(SELM, "Specified") field(SELL, "HL2:SBPM:HL36:VSCL_CTRL NPP NMS") } # The $[parm]_SEL record holds all possible # values of $[parm] in the 'A..J' fields. # # When processed it updates it's own VAL # to the currently selected input. Input # 'L' serves as the (1-based) selector, # i.e., L==1 selects 'A'->'VAL'. # # When the selected value changes (as a # result of SEQ depositing a new value OR # $[ctrl] changing and updating L) then # the propagator record attached to the # FLNK is processed. # record(sub, "HL2:SBPM:HL36:VSCL_SEL") { # field(INAM, "parmSelSubInit") field(SNAM, "parmSelSubProc") field(A, "1") field(B, "1") field(C, "") field(D, "") field(E, "") field(F, "") field(G, "") field(H, "") field(I, "") field(J, "") field(PREC, "4") field(FLNK, "HL2:SBPM:HL36:VSCL_PROP") info(autosaveFields, "A B C D E F G H I J") } # # Finally the dfanout record # fetches the currently selected # value from SEL and propagates it # to $[outl]. It also updates # $[parm] itself so that $[parm] # always reflects the currently # selected value. # record(dfanout, "HL2:SBPM:HL36:VSCL_PROP") { field(OMSL, "closed_loop") field(DOL, "HL2:SBPM:HL36:VSCL_SEL") field(OUTA, "HL2:SBPM:HL36:V.ASLO CA") field(OUTB, "HL2:SBPM:HL36:VSCL PP") } # Drive the SEL record when the 'ctrl' PV changes # Use a CA link to monitor such changes record(calcout, "HL2:SBPM:HL36:VSCL_CTRL") { field(INPA, "HL2:SBPM:HL36:PARMSEL CP") field(CALC, "A+1") field(DOPT, "Use CALC") field(OOPT, "On Change") field(OUT, "HL2:SBPM:HL36:VSCL_SEL.L PP") } # Maintain multiple (up to 10) values of # a parameter: # # Record holding the parameter $[parm] # must FLNK -> $[parm]_SEQ # # Different values of the parameter # $[parm0]..$[parm9] are stored in # $[parm]_SEL.A .. $[parm]_SEL.J # # The actual value of the parameter is # selected based on the value of a controlling # PV $[ctrl] using a 'mapping' CALC expression # $[mapc] to convert the $[ctrl] value into # the integer range 1..10. # # The selected value of $[parm] is written # to output link $[outl] # # A) When the user writes $[parm] then # its value is deposited in the currently # selected field of $[parm]_SEL and # propagated to $[outl] # # B) When the user writes any of $[parm]_SEL.A..J # then the value is stored there. If she # writes to the currently 'active' field\ # (as selected by $[ctrl]) then # the $[parm] PV itself is updated and the # value is also propagated to $[outl] # # C) If the user changes $[ctrl] then the # corresponding value $[parm]_SEL.A..J is # propagated to $[outl] and $[parm]. # # D) At initialization, the value corresponding # to the initial setting of $[ctrl] is written # to $[outl] and $[parm] # # MACROS: # # $[parm] PV holding the parameter # $[ctrl] PV that controls the selection of # the currently active setting of # $[parm] # $[outl] PV where the currently selected # value of $[parm] shall be written-to # (if applicable) # $[prec] Precision of the $[parm]_SEL variable # (should be set to same value as $[parm].PREC) # # $[parm0]..$[parm9] initial values of $[parm] # # $[mapc] CALC expression to convert the value # of the controlling PV which is available # as 'A' to the range 1..10 (or less if # less selections are used). # E.g., to convert the value of a bo (0/1) # you would set mapc to 'A+1' (0..1 -> 1..2) # # NOTE: This sb snippet is loaded/expanded # for every parameter under control # of $[ctrl]. ALSO, the companion # snippet parmCtl.db must be loaded/expanded # but only once per controlling PV. # # This record, when scanned (as a result # of $[parm] being written and processing # its FLNK to this record] fetches $[parm] # and deposits the value into the currently # selected field of the SEL record. # # NOTE: unfortunately, the selection # mechanism of the SEQ and SEL # records differs: SEQ is 1-based, # SEL is 0-based -- now that makes # sense, doesn't it? # record(seq, "HL2:SBPM:HL36:PHI_SEQ") { field(DESC, "Propagate Parm -> SEL") field(DOL1, "HL2:SBPM:HL36:PHI") field(DOL2, "HL2:SBPM:HL36:PHI") field(DOL3, "HL2:SBPM:HL36:PHI") field(DOL4, "HL2:SBPM:HL36:PHI") field(DOL5, "HL2:SBPM:HL36:PHI") field(DOL6, "HL2:SBPM:HL36:PHI") field(DOL7, "HL2:SBPM:HL36:PHI") field(DOL8, "HL2:SBPM:HL36:PHI") field(DOL9, "HL2:SBPM:HL36:PHI") field(DOLA, "HL2:SBPM:HL36:PHI") field(LNK1, "HL2:SBPM:HL36:PHI_SEL.A PP") field(LNK2, "HL2:SBPM:HL36:PHI_SEL.B PP") field(LNK3, "HL2:SBPM:HL36:PHI_SEL.C PP") field(LNK4, "HL2:SBPM:HL36:PHI_SEL.D PP") field(LNK5, "HL2:SBPM:HL36:PHI_SEL.E PP") field(LNK6, "HL2:SBPM:HL36:PHI_SEL.F PP") field(LNK7, "HL2:SBPM:HL36:PHI_SEL.G PP") field(LNK8, "HL2:SBPM:HL36:PHI_SEL.H PP") field(LNK9, "HL2:SBPM:HL36:PHI_SEL.I PP") field(LNKA, "HL2:SBPM:HL36:PHI_SEL.J PP") field(SELM, "Specified") field(SELL, "HL2:SBPM:HL36:PHI_CTRL NPP NMS") } # The $[parm]_SEL record holds all possible # values of $[parm] in the 'A..J' fields. # # When processed it updates it's own VAL # to the currently selected input. Input # 'L' serves as the (1-based) selector, # i.e., L==1 selects 'A'->'VAL'. # # When the selected value changes (as a # result of SEQ depositing a new value OR # $[ctrl] changing and updating L) then # the propagator record attached to the # FLNK is processed. # record(sub, "HL2:SBPM:HL36:PHI_SEL") { # field(INAM, "parmSelSubInit") field(SNAM, "parmSelSubProc") field(A, "0") field(B, "0") field(C, "") field(D, "") field(E, "") field(F, "") field(G, "") field(H, "") field(I, "") field(J, "") field(PREC, "1") field(FLNK, "HL2:SBPM:HL36:PHI_PROP") info(autosaveFields, "A B C D E F G H I J") } # # Finally the dfanout record # fetches the currently selected # value from SEL and propagates it # to $[outl]. It also updates # $[parm] itself so that $[parm] # always reflects the currently # selected value. # record(dfanout, "HL2:SBPM:HL36:PHI_PROP") { field(OMSL, "closed_loop") field(DOL, "HL2:SBPM:HL36:PHI_SEL") field(OUTA, "HL2:SBPM:HL36:CALC.E CA") field(OUTB, "HL2:SBPM:HL36:PHI PP") } # Drive the SEL record when the 'ctrl' PV changes # Use a CA link to monitor such changes record(calcout, "HL2:SBPM:HL36:PHI_CTRL") { field(INPA, "HL2:SBPM:HL36:PARMSEL CP") field(CALC, "A+1") field(DOPT, "Use CALC") field(OOPT, "On Change") field(OUT, "HL2:SBPM:HL36:PHI_SEL.L PP") } # Maintain multiple (up to 10) values of # a parameter: # # Record holding the parameter $[parm] # must FLNK -> $[parm]_SEQ # # Different values of the parameter # $[parm0]..$[parm9] are stored in # $[parm]_SEL.A .. $[parm]_SEL.J # # The actual value of the parameter is # selected based on the value of a controlling # PV $[ctrl] using a 'mapping' CALC expression # $[mapc] to convert the $[ctrl] value into # the integer range 1..10. # # The selected value of $[parm] is written # to output link $[outl] # # A) When the user writes $[parm] then # its value is deposited in the currently # selected field of $[parm]_SEL and # propagated to $[outl] # # B) When the user writes any of $[parm]_SEL.A..J # then the value is stored there. If she # writes to the currently 'active' field\ # (as selected by $[ctrl]) then # the $[parm] PV itself is updated and the # value is also propagated to $[outl] # # C) If the user changes $[ctrl] then the # corresponding value $[parm]_SEL.A..J is # propagated to $[outl] and $[parm]. # # D) At initialization, the value corresponding # to the initial setting of $[ctrl] is written # to $[outl] and $[parm] # # MACROS: # # $[parm] PV holding the parameter # $[ctrl] PV that controls the selection of # the currently active setting of # $[parm] # $[outl] PV where the currently selected # value of $[parm] shall be written-to # (if applicable) # $[prec] Precision of the $[parm]_SEL variable # (should be set to same value as $[parm].PREC) # # $[parm0]..$[parm9] initial values of $[parm] # # $[mapc] CALC expression to convert the value # of the controlling PV which is available # as 'A' to the range 1..10 (or less if # less selections are used). # E.g., to convert the value of a bo (0/1) # you would set mapc to 'A+1' (0..1 -> 1..2) # # NOTE: This sb snippet is loaded/expanded # for every parameter under control # of $[ctrl]. ALSO, the companion # snippet parmCtl.db must be loaded/expanded # but only once per controlling PV. # # This record, when scanned (as a result # of $[parm] being written and processing # its FLNK to this record] fetches $[parm] # and deposits the value into the currently # selected field of the SEL record. # # NOTE: unfortunately, the selection # mechanism of the SEQ and SEL # records differs: SEQ is 1-based, # SEL is 0-based -- now that makes # sense, doesn't it? # record(seq, "HL2:SBPM:HL36:PSI_SEQ") { field(DESC, "Propagate Parm -> SEL") field(DOL1, "HL2:SBPM:HL36:PSI") field(DOL2, "HL2:SBPM:HL36:PSI") field(DOL3, "HL2:SBPM:HL36:PSI") field(DOL4, "HL2:SBPM:HL36:PSI") field(DOL5, "HL2:SBPM:HL36:PSI") field(DOL6, "HL2:SBPM:HL36:PSI") field(DOL7, "HL2:SBPM:HL36:PSI") field(DOL8, "HL2:SBPM:HL36:PSI") field(DOL9, "HL2:SBPM:HL36:PSI") field(DOLA, "HL2:SBPM:HL36:PSI") field(LNK1, "HL2:SBPM:HL36:PSI_SEL.A PP") field(LNK2, "HL2:SBPM:HL36:PSI_SEL.B PP") field(LNK3, "HL2:SBPM:HL36:PSI_SEL.C PP") field(LNK4, "HL2:SBPM:HL36:PSI_SEL.D PP") field(LNK5, "HL2:SBPM:HL36:PSI_SEL.E PP") field(LNK6, "HL2:SBPM:HL36:PSI_SEL.F PP") field(LNK7, "HL2:SBPM:HL36:PSI_SEL.G PP") field(LNK8, "HL2:SBPM:HL36:PSI_SEL.H PP") field(LNK9, "HL2:SBPM:HL36:PSI_SEL.I PP") field(LNKA, "HL2:SBPM:HL36:PSI_SEL.J PP") field(SELM, "Specified") field(SELL, "HL2:SBPM:HL36:PSI_CTRL NPP NMS") } # The $[parm]_SEL record holds all possible # values of $[parm] in the 'A..J' fields. # # When processed it updates it's own VAL # to the currently selected input. Input # 'L' serves as the (1-based) selector, # i.e., L==1 selects 'A'->'VAL'. # # When the selected value changes (as a # result of SEQ depositing a new value OR # $[ctrl] changing and updating L) then # the propagator record attached to the # FLNK is processed. # record(sub, "HL2:SBPM:HL36:PSI_SEL") { # field(INAM, "parmSelSubInit") field(SNAM, "parmSelSubProc") field(A, "90") field(B, "90") field(C, "") field(D, "") field(E, "") field(F, "") field(G, "") field(H, "") field(I, "") field(J, "") field(PREC, "1") field(FLNK, "HL2:SBPM:HL36:PSI_PROP") info(autosaveFields, "A B C D E F G H I J") } # # Finally the dfanout record # fetches the currently selected # value from SEL and propagates it # to $[outl]. It also updates # $[parm] itself so that $[parm] # always reflects the currently # selected value. # record(dfanout, "HL2:SBPM:HL36:PSI_PROP") { field(OMSL, "closed_loop") field(DOL, "HL2:SBPM:HL36:PSI_SEL") field(OUTA, "HL2:SBPM:HL36:CALC.F CA") field(OUTB, "HL2:SBPM:HL36:PSI PP") } # Drive the SEL record when the 'ctrl' PV changes # Use a CA link to monitor such changes record(calcout, "HL2:SBPM:HL36:PSI_CTRL") { field(INPA, "HL2:SBPM:HL36:PARMSEL CP") field(CALC, "A+1") field(DOPT, "Use CALC") field(OOPT, "On Change") field(OUT, "HL2:SBPM:HL36:PSI_SEL.L PP") } record(longout, "HL2:SBPM:HL36:PARMSEL") { field(VAL, "0") field(PINI, "YES") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBDEND # per BPM database for stripline BPMs ############################################## # This is the head of the main processing chain # that runs at the highest priority. ############################################## ############################################# # This is the head of the processing chain for # diagnostics. ############################################## record(ai, "HL2:SBPM:HL37:GRN") { field(DESC, "GRN Strip Amplitude") field(DTYP, "Raw Bpm Signal") # 'card' selects PAD number, 'signal' selects strip field(INP, "#C1 S0") field(EGU, "raw") #TODO set HOPR/LOPR, alarm limits field(SCAN, "I/O Intr") # The priority determines what scan list we are being # put on (see drvPadUdpComm.c) field(PRIO, "LOW") field(FLNK, "HL2:SBPM:HL37:RED") # HOPR for the energy algorithm is determined as follows: # # inf inf # 1) Fourier relation / h^2 dt = / |H|^2 df = 2 B # 0 -inf # # 1a) It can be shown that the maximum of the impuls response # ha is ~ 2 B # # 2) The digitizer produces the numbers # # Ai = 2^s (hi/ha) # # where ha is the maximum of the impuls response # and 2^s is a scale factor. # # 3) 'Energy algorithm' calculates S = sum( Ai^2 ) # # inf # 4) S = (2^s / ha)^2 sum(hi^2) = K sum(hi^2) Dt ~ K / h^2 dt # 0 # # with K = (2^s / ha)^2 fs # # 5) From 4) and 1a) -> S ~ K ha and therefore # # 6) S = 2^(2s) fs/ha = 2^(2s) fs/(2 B) # # 7) The strip signals are sqrt(S); hence HOPR is about # # HOPR ~ 2^s sqrt( fs/2/B ) # # with 2^s = 32768, fs=120MHz, B=10MHz it follows # that HOPR ~ 1E5; we add some margin... field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(ai, "HL2:SBPM:HL37:RED") { field(DESC, "RED Strip Amplitude") field(DTYP, "Raw Bpm Signal") # 'card' selects PAD number, 'signal' selects strip field(INP, "#C1 S1") field(EGU, "raw") field(SCAN, "Passive") field(FLNK, "HL2:SBPM:HL37:BLU") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(ai, "HL2:SBPM:HL37:BLU") { field(DESC, "BLU Strip Amplitude") field(DTYP, "Raw Bpm Signal") # 'card' selects PAD number, 'signal' selects strip field(INP, "#C1 S2") field(EGU, "raw") field(SCAN, "Passive") field(FLNK, "HL2:SBPM:HL37:YLO") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(ai, "HL2:SBPM:HL37:YLO") { field(DESC, "YLO Strip Amplitude") field(DTYP, "Raw Bpm Signal") # 'card' selects PAD number, 'signal' selects strip field(INP, "#C1 S3") field(EGU, "raw") field(SCAN, "Passive") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } ############################################## # Slowly-scanned diagnostics ############################################## # record(waveform, "HL2:SBPM:HL37:REDW") { field(DESC, "Raw CAL RED Data") field(DTYP, "WavBuf") # 'signal' number selects 'beam', 'calX', 'calY' field(INP, "#C1 S1") field(NELM, "512") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32768") field(LOPR, "-32767") field(SCAN, "1 second") } record(waveform, "HL2:SBPM:HL37:GRNW") { field(DESC, "Raw CAL GRN Data") field(DTYP, "WavBuf") # 'signal' number selects 'beam', 'calX', 'calY' field(INP, "#C1 S2") field(NELM, "512") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32768") field(LOPR, "-32767") field(SCAN, "1 second") } record(waveform, "HL2:SBPM:HL37:RAWDBG") { field(DESC, "Raw BEAM Dbg") field(DTYP, "WavBuf") # 'signal' number selects 'beam', 'calX', 'calY' # do not 'wbscan' for now since e.g., an underrange # condition on the real signal can happen. field(INP, "#C1 S7") field(NELM, "512") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32768") field(LOPR, "-32767") field(SCAN, "Passive") } record(waveform, "HL2:SBPM:HL37:REDDBG") { field(DESC, "Raw CAL RED Dbg") field(DTYP, "WavBuf") # 'signal' number selects 'beam', 'calX', 'calY' field(INP, "#C1 S8 @wbscan") field(NELM, "512") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32768") field(LOPR, "-32767") field(SCAN, "Passive") } record(waveform, "HL2:SBPM:HL37:GRNDBG") { field(DESC, "Raw CAL GRN Dbg") field(DTYP, "WavBuf") # 'signal' number selects 'beam', 'calX', 'calY' field(INP, "#C1 S9 @wbscan") field(NELM, "512") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32768") field(LOPR, "-32767") field(SCAN, "Passive") } record(ai, "HL2:SBPM:HL37:GRUV") { field(DESC, "CAL Gain GRN/RED") field(DTYP, "Raw Stripl Calp") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C1 S0") field(SCAN, "10 second") field(PREC, "4") field(LOPR, "0.5") field(HOPR, "1.5") } record(ai, "HL2:SBPM:HL37:GRU") { field(DESC, "CAL Gain GRN/BLU") field(DTYP, "Raw Stripl Calp") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C1 S1") field(SCAN, "10 second") field(PREC, "4") field(LOPR, "0.5") field(HOPR, "1.5") info(autosaveFields, "ASLO") } record(ai, "HL2:SBPM:HL37:GRV") { field(DESC, "CAL Gain RED/YLO") field(DTYP, "Raw Stripl Calp") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C1 S2") field(SCAN, "10 second") field(PREC, "4") field(LOPR, "0.5") field(HOPR, "1.5") info(autosaveFields, "ASLO") } record(ai, "HL2:SBPM:HL37:TGRN") { field(DESC, "Green arrival time") field(DTYP, "Raw Bpm Signal") field(EGU, "ADC Clocks") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C1 S4") field(SCAN, "10 second") field(PREC, "1") field(LOPR, "0") field(HOPR, "128") field(LOLO, "5") field(LOW, "8") field(HIGH, "60") field(HIHI, "70") field(LLSV, "MAJOR") field(LSV, "MINOR") field(HSV, "MINOR") field(HHSV, "MAJOR") } record(ai, "HL2:SBPM:HL37:TRED") { field(DESC, "Red arrival time") field(DTYP, "Raw Bpm Signal") field(EGU, "ADC Clocks") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C1 S5") field(SCAN, "10 second") field(PREC, "1") field(LOPR, "0") field(HOPR, "128") field(LOLO, "5") field(LOW, "8") field(HIGH, "60") field(HIHI, "70") field(LLSV, "MAJOR") field(LSV, "MINOR") field(HSV, "MINOR") field(HHSV, "MAJOR") } record(ai, "HL2:SBPM:HL37:TBLU") { field(DESC, "Blue arrival time") field(DTYP, "Raw Bpm Signal") field(EGU, "ADC Clocks") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C1 S6") field(SCAN, "10 second") field(PREC, "1") field(LOPR, "0") field(HOPR, "128") field(LOLO, "5") field(LOW, "8") field(HIGH, "60") field(HIHI, "70") field(LLSV, "MAJOR") field(LSV, "MINOR") field(HSV, "MINOR") field(HHSV, "MAJOR") } record(ai, "HL2:SBPM:HL37:TYLO") { field(DESC, "Yellow arrival time") field(DTYP, "Raw Bpm Signal") field(EGU, "ADC Clocks") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C1 S7") field(SCAN, "10 second") field(PREC, "1") field(LOPR, "0") field(HOPR, "128") field(LOLO, "5") field(LOW, "8") field(HIGH, "60") field(HIHI, "70") field(LLSV, "MAJOR") field(LSV, "MINOR") field(HSV, "MINOR") field(HHSV, "MAJOR") } record(ao, "HL2:SBPM:HL37:PINC_ADJ") { field(DESC, "Adjust Pinc. Corr.") field(DTYP, "Soft Channel") field(OUT, "HL2:SBPM:HL37:CALC.K PP MS") field(VAL, "0") field(DRVL, "0") field(DRVH, "2") field(PINI, "YES") info(autosaveFields, "VAL") } # QSCL setting: # # Q: charge # Z: impedance # F: form factor: phi/(2 pi) sin(2 pi f l/c) # # Signal = Q Z F G h(t) = A h(t) [A] = Vs # # inf inf # Energy = A^2 / h^2(t) dt = A^2 / |H(w)|^2 dw/2/pi = A^2 B # 0 0 # # Measured energy = Sum{ (Vp/32768 * xi)^2 } / fs = S / fs ~ Energy # # -> A^2 B = S/fs # # With T = sqrt( Sum{ xi^2 } ) # # A = sqrt(S)/sqrt(B*fs) = T/sqrt(B*fs) Vp/32768 # # T/32768 Vp # Q = A/F/G/Z = ----------------- # F G Z sqrt(B*fs) # # Vp = { 1.5Vpp/2 (PGA=1) or 2.25Vpp/2 (PGA=0) } / 2 (transformer) # # I believe PGA is off (-> Vp ~ .56V) # # Z = 50 # # G: (calibration uses GRN/BLU -> signal should have the # level of the grn/red channels with the additional switch) # # Block diagram / parts / gain: # # [filt] [Att1] [Amp1] [Att2] [BPF] [Amp2] [pad] [Amp3] [switch] # f-17520 hmc540lp3 SBF-5089 hmc540lp3 MBP-140-6-4 SBF-4089 PAT-0 SBF-4089 HMC-197 # # -2dB* -1dB 20dB -1dB -4.5 14.8dB 0dB 14.8dB -0.4dB # # *: 1st filter ATT is a wild guess. # BPF loss (RLC Catalog, pp.55): (L (nsect+.5) / (% of 3dB BW) + .2) dB # with L ~6.2 10MHz/fc=140Mhz filter-> 4.5 # # -> Gtot ~ 40.7dB # # subtract cable loss (2dB); Gtot = 86 # # T/32768 Vp .56V/32768 # Q = A/F/G/Z = ----------------- = T/F ------------------------ # F G Z sqrt(B*fs) 86*50*sqrt(10*140)Mhz # # = T/F = 1.06E-7/F nC # # F for a 7% coverage, 4" BPM at 140MHz .07 sin(2*pi*140e6 4*.0254/3e8) # = .021 # # => 1.06E-7/.021 nC = 5E-6 nC # # (Faraday cup measurement -> (3600/44)^-1 1e-4 -> 1.22E-6 # record(ao, "HL2:SBPM:HL37:QSCL") { field(DESC, "TMIT/Charge Scale") field(DTYP, "Soft Channel") field(OUT, "HL2:SBPM:HL37:QSCA.A PP MS") # 5.0E-6 / 1.6E-10 [nC/e-] field(VAL, "31250") field(EGU, "Nel") field(PREC, "3") field(PINI, "YES") info(autosaveFields, "VAL") } # Adjust TMIT scale for AFE attenuation record(calcout, "HL2:SBPM:HL37:QSCA") { field(DESC, "TMIT ATT Adj. Scale") field(INPB, "HL2:SBPM:HL37:ATT1 CP") field(INPC, "HL2:SBPM:HL37:ATT2 CP") field(CALC, "A*10^((B+C+D)/20)") # use CA link to deposit into TMIT.ASLO so # that TMIT is not forced into linkset # of this record field(OUT, "HL2:SBPM:HL37:TMIT.ASLO CA") field(EGU, "Nel") field(PREC, "3") info(autosaveFields, "D") } record(ao, "HL2:SBPM:HL37:ATT1SIMP") { field(DESC, "ATT1 Propagator") field(DTYP, "Soft Channel") field(DOL, "HL2:SBPM:HL37:ATT1 CP") field(OMSL, "closed_loop") field(OUT, "HL2:SBPM:HL37:ASIM.A PP") field(IVOA, "Set output to IVOV") field(IVOV, "0") field(EGU, "dB") } record(ao, "HL2:SBPM:HL37:ATT2SIMP") { field(DESC, "ATT2 Propagator") field(DTYP, "Soft Channel") field(DOL, "HL2:SBPM:HL37:ATT2 CP") field(OMSL, "closed_loop") field(OUT, "HL2:SBPM:HL37:ASIM.C PP") field(IVOA, "Set output to IVOV") field(IVOV, "0") field(EGU, "dB") } # Attenuate charge either by # real attenuator settings or # by fake ones. # If B, C >= 0 then their # values will be used instead # of ATT1, ATT2 record(calcout, "HL2:SBPM:HL37:ASIM") { field(DESC, "Q Simul Attenuator") field(DTYP, "Soft Channel") field(OUT, "HL2:SBPM:HL37:QSIM.ESLO PP") # ATT1SIM puts value into A # set to -1 to use real attenuator settings # and >=0 to use B instead field(B, "-1") # ATT2SIM puts value into C # set to -1 to use real attenuator settings # and >=0 to use D instead field(D, "-1") field(CALC, "10^(((B>=0?B:A)+(D>=0?D:C))/20)") field(PINI, "YES") } record(ao, "HL2:SBPM:HL37:WSIM") { field(DESC, "BPM W Simul.") field(DTYP, "Soft Channel") field(OUT, "HL2:SBPM:HL37:SIM.G PP") field(VAL, "0.07") field(EGU, "%") field(PINI, "YES") field(PREC, "3") field(LOPR, "0") field(HOPR, "0.25") } record(sel, "HL2:SBPM:HL37:STA") { field(DESC, "Status Summary") field(SELM, "High Signal") field(INPA, "HL2:SBPM:HL37:RSTA.SEVR MS NPP") field(INPB, "HL2:SBPM:HL37:TMIT.SEVR MS NPP") field(INPC, "HL2:SBPM:HL37:Y.SEVR MS NPP") field(INPD, "HL2:SBPM:HL37:X.SEVR MS NPP") field(INPE, "HL2:SBPM:HL37:TGRN.SEVR MS NPP") field(INPF, "HL2:SBPM:HL37:TRED.SEVR MS NPP") field(INPG, "HL2:SBPM:HL37:TBLU.SEVR MS NPP") field(INPH, "HL2:SBPM:HL37:TYLO.SEVR MS NPP") field(INPI, "HL2:SBPM:HL37:GRU.SEVR MS NPP") field(INPJ, "HL2:SBPM:HL37:GRV.SEVR MS NPP") field(SCAN, "1 second") } # This record really belongs on the # PAD IOC. We keep them here however # so we can save/restore. It is more # confusing but shouldn't matter from # an efficiency standpoint (they are # rarely changed). record(longout, "HL2:SBPM:HL37:ATTO") { field(DESC, "AFE Tot. Att. Offset") # fetched via inlink #field(OUT, "HL2:SBPM:HL37:ATTC.B PP") field(DRVL, "-10") field(DRVH, "30") field(LOPR, "-10") field(HOPR, "30") field(EGU, "dB") field(VAL, "0") field(PINI, "YES") info(autosaveFields, "VAL DRVH HOPR DRVL LOPR") } # This record really belongs on the # PAD IOC. We keep them here however # so we can save/restore. It is more # confusing but shouldn't matter from # an efficiency standpoint (they are # rarely changed). record(longout, "HL2:SBPM:HL37:CLAO") { field(DESC, "AFE Cal. Att. Offset") # fetched via inlink #field(OUT, "HL2:SBPM:HL37:ATTC.C PP") field(DRVL, "-20") field(DRVH, "20") field(LOPR, "-20") field(HOPR, "20") field(EGU, "dB") field(VAL, "40") field(PINI, "YES") info(autosaveFields, "VAL DRVH HOPR DRVL LOPR") } record(calc, "HL2:SBPM:HL37:STA_ALH") { field(DESC, "Status Summary") field(SCAN, "1 second") field(CALC, "0") field(INPA, "HL2:SBPM:HL37:RSTA_ALH.SEVR MS NPP") field(INPB, "HL2:SBPM:HL37:GRU.SEVR MS NPP") field(INPC, "HL2:SBPM:HL37:GRV.SEVR MS NPP") field(INPD, "HL2:SBPM:HL37:CHK.SEVR MS NPP") field(INPE, "") field(INPF, "HL2:SBPM:HL37:AFE_COMM.SEVR MS NPP") } # snapshot PV for the bpm values display record(ai, "HL2:SBPM:HL37:GRN_SLOW") { field(DESC, "GRN snapshot for display") field(INP, "HL2:SBPM:HL37:GRN NPP MS") field(EGU, "raw") field(SCAN, "1 second") field(FLNK, "HL2:SBPM:HL37:RED_SLOW") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(ai, "HL2:SBPM:HL37:RED_SLOW") { field(DESC, "RED snapshot for display") # 'card' selects PAD number, 'signal' selects strip field(INP, "HL2:SBPM:HL37:RED NPP MS") field(EGU, "raw") field(SCAN, "Passive") field(FLNK, "HL2:SBPM:HL37:BLU_SLOW") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(ai, "HL2:SBPM:HL37:BLU_SLOW") { field(DESC, "BLU snapshot for display") # 'card' selects PAD number, 'signal' selects strip field(INP, "HL2:SBPM:HL37:BLU NPP MS") field(EGU, "raw") field(SCAN, "Passive") field(FLNK, "HL2:SBPM:HL37:YLO_SLOW") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(ai, "HL2:SBPM:HL37:YLO_SLOW") { field(DESC, "YLO snapshot for display") field(INP, "HL2:SBPM:HL37:YLO NPP MS") field(EGU, "raw") field(SCAN, "Passive") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(sub, "HL2:SBPM:HL37:CALC") { field(SNAM, "drvBpmBvectSetupSub") # E: phi F: psi # BPM channel number in L field(INPL, "1") field(SCAN, "Passive") } record(bo, "HL2:SBPM:HL37:PINC_ENA") { field(DESC, "Simple Pincushion Alg") field(DTYP, "BusAddress") field(OUT, "#C0S2@drvBpmStriplPincEna,m32") field(MASK, "2") field(ZNAM, "DISABLED") field(ONAM, "ENABLED") field(VAL, "0") field(PINI, "YES") info(autosaveFields, "VAL") } record(ao, "HL2:SBPM:HL37:UDR_THRES") { field(DESC, "Detection Underrange Threshold") field(DTYP, "Bpm Parameters") field(OUT, "#C1S0") field(EGU, "ADC Ticks") field(DOL, "45.26") field(PINI, "YES") field(DRVL, "0") field(DRVH, "32767") info(autosaveFields, "VAL") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBDEND # per BPM database for stripline BPMs ###################################### # HEAD of main processing chain ###################################### record(ai, "HL2:SBPM:HL37:X") { field(DESC, "X Position") field(EGU, "mm") field(DTYP, "Raw Bpm Signal") field(INP, "#C1 S11") field(SCAN, "I/O Intr") # The priority determines what scan list we are being # put on (see drvPadUdpComm.c) field(PRIO, "HIGH") field(FLNK, "HL2:SBPM:HL37:Y") field(PREC, "4") field(LOPR, "-12") field(HOPR, "+12") field(ASG, "") field(TSE, "-2") info(autosaveFields, "ASLO LOLO LOW HIGH HIHI HHSV LLSV") } record(ai, "HL2:SBPM:HL37:Y") { field(DESC, "Y Position") field(EGU, "mm") field(DTYP, "Raw Bpm Signal") field(INP, "#C1 S12") field(FLNK, "HL2:SBPM:HL37:TMIT") field(PREC, "4") field(LOPR, "-12") field(HOPR, "+12") field(ASG, "") field(TSE, "-2") info(autosaveFields, "ASLO LOLO LOW HIGH HIHI HHSV LLSV") } record(ai, "HL2:SBPM:HL37:TMIT") { field(DESC, "Charge Estimate") field(DTYP, "Raw Bpm Signal") field(INP, "#C1 S13") field(EGU, "Nel") field(PREC, "3") field(LOPR, "0") field(HOPR, "1E11") # FLINK into BSA field(FLNK, "HL2:SBPM:HL37:EFX.PROC") field(ASG, "") field(TSE, "-2") info(autosaveFields, "LOLO LOW HIGH HIHI HHSV LLSV ") } ###################################### # HEAD of diagnostics processing chain ###################################### # leave RWAV in it's own lockset; don't FLNK # to 'U' & friends record(waveform, "HL2:SBPM:HL37:RWAV") { field(DESC, "Raw BPM Data") field(DTYP, "WavBuf") # 'signal' number selects 'beam', 'calX', 'calY' field(INP, "#C1 S0") field(SCAN, "I/O Intr") # use LOW or HIGH to end up on the 'diagnostic' # scan list (see drvPadUdpComm.c) field(PRIO, "LOW") field(NELM, "512") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32768") field(LOPR, "-32767") } record(ai, "HL2:SBPM:HL37:U") { field(DESC, "Raw U Position") field(DTYP, "Raw Bpm Signal") field(INP, "#C1 S8") field(SCAN, "I/O Intr") # use LOW or HIGH to end up on the 'diagnostic' # scan list (see drvPadUdpComm.c) field(PRIO, "LOW") field(PREC, "5") field(EGU, "mm") field(LOPR, "-0.7") field(HOPR, "+0.7") field(FLNK, "HL2:SBPM:HL37:V") } record(ai, "HL2:SBPM:HL37:V") { field(DESC, "Raw V Position") field(DTYP, "Raw Bpm Signal") field(INP, "#C1 S9") field(SCAN, "Passive") field(PREC, "5") field(EGU, "mm") field(LOPR, "-0.7") field(HOPR, "+0.7") field(FLNK, "HL2:SBPM:HL37:PINC") } record(ai, "HL2:SBPM:HL37:PINC") { field(DESC, "Pin Cushion Corr.") field(DTYP, "Raw Bpm Signal") field(INP, "#C1 S10") field(SCAN, "Passive") } record(longin, "HL2:SBPM:HL37:RSTA") { field(DESC, "Status of Raw Processor") field(DTYP, "Bpm Raw Status") field(INP, "#C1S0") field(SCAN, "1 second") field(LOLO, "-1") field(HIHI, "+1") field(HHSV, "INVALID") field(LLSV, "INVALID") field(FLNK, "HL2:SBPM:HL37:RSTA_ALH") } record(calc, "HL2:SBPM:HL37:RSTA_ALH") { field(CALC, "A & B") field(INPA, "HL2:SBPM:HL37:RSTA") field(INPB, "0x30F") field(HIHI, "1") field(LOLO, "-1") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(SCAN, "Passive") } ###################################### # Input/Parameteres ###################################### record(ao, "HL2:SBPM:HL37:PHI") { field(DESC, "Rot Angle") field(DTYP, "Soft Channel") field(VAL, "0") field(EGU, "deg") field(PREC, "1") field(LOPR, "-180") field(HOPR, "+180") field(FLNK, "HL2:SBPM:HL37:PHI_SEQ") } record(ao, "HL2:SBPM:HL37:PSI") { field(DESC, "Axis Sep. Angle") field(DTYP, "Soft Channel") field(VAL, "90") field(EGU, "deg") field(PREC, "1") field(LOPR, "0") field(HOPR, "+180") field(FLNK, "HL2:SBPM:HL37:PSI_SEQ") } #record(dfanout, "HL2:SBPM:HL37:PCMM") { # field(DESC, "BPM Scale") # field(OUTA, "HL2:SBPM:HL37:USCL PP MS") # field(OUTB, "HL2:SBPM:HL37:VSCL PP MS") # field(VAL, "12") # field(EGU, "mm") # field(PREC, "4") # field(LOPR, "5") # field(HOPR, "15") # field(PINI, "YES") #} record(ao, "HL2:SBPM:HL37:UOFF") { field(DESC, "BPM U Offset") field(DTYP, "Soft Channel") field(VAL, "0") field(EGU, "mm") field(PREC, "4") field(LOPR, "-5") field(HOPR, "+5") field(FLNK, "HL2:SBPM:HL37:UOFF_SEQ") } record(ao, "HL2:SBPM:HL37:VOFF") { field(DESC, "BPM V Offset") field(DTYP, "Soft Channel") field(VAL, "0") field(EGU, "mm") field(PREC, "4") field(LOPR, "-5") field(HOPR, "+5") field(FLNK, "HL2:SBPM:HL37:VOFF_SEQ") } record(ao, "HL2:SBPM:HL37:USCL") { field(DESC, "BPM U Scale") field(DTYP, "Soft Channel") field(VAL, "1") field(EGU, "mm") field(PREC, "4") field(FLNK, "HL2:SBPM:HL37:USCL_SEQ") } record(ao, "HL2:SBPM:HL37:VSCL") { field(DESC, "BPM V Scale") field(DTYP, "Soft Channel") field(VAL, "1") field(EGU, "mm") field(PREC, "4") field(FLNK, "HL2:SBPM:HL37:VSCL_SEQ") } record(mbbo, "HL2:SBPM:HL37:ACCESS") { field(DESC, "BPM On Line") field(DTYP, "StreamSwitch") field(OUT, "#C1 S0") field(ZRVL, "1") field(ZRST, "Running") field(ZRSV, "NO_ALARM") field(ONVL, "1") field(ONST, "Maintenance") field(ONSV, "MINOR") field(TWVL, "1") field(TWST, "Test") field(TWSV, "MINOR") field(THVL, "0") field(THST, "OFFLINE") field(THSV, "MAJOR") # set both, rval and val to get it right # regardless of whether devsup does conversion # or not. field(RVAL, "0") field(VAL, "0") field(PINI, "YES") field(FLNK, "HL2:SBPM:HL37:SIMOFF") info(autosaveFields, "RVAL") } # # 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, "HL2:SBPM:HL37:FBCK") { field(DESC, "Feedback State") field(PINI, "YES") field(OMSL, "supervisory") field(VAL, "0") field(ZRVL, "0") field(ONVL, "1") field(TWVL, "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") info(autosaveFields, "VAL") } # Convenience record holding the MAD name record(stringin, "HL2:SBPM:HL37:MADN") { field(DESC, "MAD Name") field(VAL, "SBPMHL37") field(PINI, "YES") } record(stringin, "SBPMHL37:NAME") { field(DESC, "BPM Name") field(VAL, "HL2:SBPM:HL37") field(PINI, "YES") } record(ai, "HL2:SBPM:HL37:X_SLOW") { #alias("HL2:SBPM:HL37:X1H") field(DESC, "X snapshot for display") field(EGU, "mm") field(INP, "HL2:SBPM:HL37:X MS") field(FLNK, "HL2:SBPM:HL37:Y_SLOW") field(PREC, "4") field(SCAN, "1 second") field(LOPR, "-12") field(HOPR, "+12") } record(ai, "HL2:SBPM:HL37:Y_SLOW") { #alias("HL2:SBPM:HL37:Y1H") field(DESC, "Y snapshot for display") field(EGU, "mm") field(INP, "HL2:SBPM:HL37:Y NPP MS") field(FLNK, "HL2:SBPM:HL37:TMIT_SLOW") field(PREC, "4") field(LOPR, "-12") field(HOPR, "+12") } record(ai, "HL2:SBPM:HL37:TMIT_SLOW") { #alias("HL2:SBPM:HL37:TMIT1H") field(DESC, "TMIT snapshot for display") field(INP, "HL2:SBPM:HL37:TMIT NPP MS") field(EGU, "Nel") field(PREC, "3") field(LOPR, "0") field(HOPR, "1E11") } ###################################### # Simulation Parameters + Control ###################################### # switch off simulation when going off-line record(calcout, "HL2:SBPM:HL37:SIMOFF") { field(DESC, "Sim Off Propagator") field(INPA, "HL2:SBPM:HL37:ACCESS.RVAL") field(CALC, "A") field(OCAL, "0") field(OOPT, "When Zero") field(DOPT, "Use OCAL") field(OUT, "HL2:SBPM:HL37:SIMC PP") } record(calcout, "HL2:SBPM:HL37:SIM") { field(DESC, "BPM Pos. Simulation") field(DTYP, "Strip Signal Simulator") field(OUT, "1") #CALC & VAL unused; the real calculation is done # in device support. The reason this is a # calcout rather than sub is that we want # to use the OUT link... field(CALC, "A") field(INPA, "HL2:SBPM:HL37:USCL") field(INPL, "0") } # Switch simulation record HL2:SBPM:HL37:SIMCSEQ moved to # bpmCavity.db.part and bpmStripl.db.part record(mbbo, "HL2:SBPM:HL37:SIMC") { field(DESC, "Stripl Sim Ctl") field(DTYP, "Raw Soft Channel") field(OUT, "HL2:SBPM:HL37:SIMCSEQ.SELN PP") field(ZRST, "OFF") field(ZRVL, "0x0f") field(ONST, "ON") field(ONVL, "0x1c0") field(TWST, "SOFT") field(TWVL, "0x030") field(MASK, "-1") field(NOBT, "16") field(VAL, "0") field(RVAL, "0x0f") field(PINI, "YES") } record(ao, "HL2:SBPM:HL37:XSIM") { field(DESC, "BPM X Pos. Simul.") field(DTYP, "Soft Channel") field(OUT, "HL2:SBPM:HL37:SIM.B PP") field(VAL, "0.5") field(EGU, "mm") field(PINI, "YES") field(PREC, "4") field(LOPR, "-12") field(HOPR, "+12") } record(ao, "HL2:SBPM:HL37:YSIM") { field(DESC, "BPM Y Pos. Simul.") field(DTYP, "Soft Channel") field(OUT, "HL2:SBPM:HL37:SIM.C PP") field(VAL, "0.") field(EGU, "mm") field(PINI, "YES") field(PREC, "4") field(LOPR, "-12") field(HOPR, "+12") } record(ao, "HL2:SBPM:HL37:QSIM") { field(DESC, "BPM Q Simul.") field(DTYP, "Raw Soft Channel") field(OUT, "HL2:SBPM:HL37:SIM.D PP") field(EGU, "Nel") field(ASLO, "6000") #ESLO is used to add attenuation field(LINR, "LINEAR") field(VAL, "1E9") field(PINI, "YES") field(PREC, "4") field(LOPR, "0") field(HOPR, "1E11") } record(ao, "HL2:SBPM:HL37:ROTS") { field(DESC, "BPM Rot. Simul.") field(DTYP, "Soft Channel") field(OUT, "HL2:SBPM:HL37:SIM.E PP") field(VAL, "0.") field(EGU, "deg") field(PINI, "YES") field(PREC, "1") field(LOPR, "-180") } record(ao, "HL2:SBPM:HL37:PSIS") { field(DESC, "BPM Angle. Simul.") field(DTYP, "Soft Channel") field(OUT, "HL2:SBPM:HL37:SIM.F PP") field(VAL, "90") field(EGU, "deg") field(PINI, "YES") field(PREC, "1") field(LOPR, "0") } record(aao, "HL2:SBPM:HL37:DIGISIMW") { field(DESC, "VME Digi Sim. Waveform") field(DTYP, "VmeDigi Sim Wav") field(OUT, "#C1 S0") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32678") field(LOPR, "-32768") # 16384 samples/channel * 4 channels field(NELM, "65536") field(PINI, "NO") } #Used by model/database folks to verify BPM record(ao, "HL2:SBPM:HL37:Z") { field(DESC, "Z Position") field(PINI, "YES") info(autosaveFields, "VAL") } # MPS interface record(bo, "HL2:SBPM:HL37:MPSBYP") { field(DESC, "MPS Bypass") field(DTYP, "BusAddress") field(OUT, "#C0S2@bpmMPS+0,m32") field(MASK, "2") field(ZNAM, "BYPASSED") field(ONAM, "NOT_BYPASSED") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(VAL, "0") field(PINI, "YES") field(ASG, "") info(autosaveFields, "VAL") } record(bo, "HL2:SBPM:HL37:MPSLTBYP") { field(DESC, "MPS Bypass") field(DTYP, "BusAddress") field(OUT, "#C1S2@bpmMPS+0,m32") field(MASK, "2") field(ZNAM, "BYPASSED") field(ONAM, "NOT_BYPASSED") field(ZSV, "NO_ALARM") field(OSV, "NO_ALARM") field(VAL, "0") field(PINI, "YES") field(ASG, "") info(autosaveFields, "VAL") } record(calc, "HL2:SBPM:HL37:MPSIGNRCALC") { field(DESC, "MPS ignore if TMIT too low") field(CALC, "A $[parm]_SEQ # # Different values of the parameter # $[parm0]..$[parm9] are stored in # $[parm]_SEL.A .. $[parm]_SEL.J # # The actual value of the parameter is # selected based on the value of a controlling # PV $[ctrl] using a 'mapping' CALC expression # $[mapc] to convert the $[ctrl] value into # the integer range 1..10. # # The selected value of $[parm] is written # to output link $[outl] # # A) When the user writes $[parm] then # its value is deposited in the currently # selected field of $[parm]_SEL and # propagated to $[outl] # # B) When the user writes any of $[parm]_SEL.A..J # then the value is stored there. If she # writes to the currently 'active' field\ # (as selected by $[ctrl]) then # the $[parm] PV itself is updated and the # value is also propagated to $[outl] # # C) If the user changes $[ctrl] then the # corresponding value $[parm]_SEL.A..J is # propagated to $[outl] and $[parm]. # # D) At initialization, the value corresponding # to the initial setting of $[ctrl] is written # to $[outl] and $[parm] # # MACROS: # # $[parm] PV holding the parameter # $[ctrl] PV that controls the selection of # the currently active setting of # $[parm] # $[outl] PV where the currently selected # value of $[parm] shall be written-to # (if applicable) # $[prec] Precision of the $[parm]_SEL variable # (should be set to same value as $[parm].PREC) # # $[parm0]..$[parm9] initial values of $[parm] # # $[mapc] CALC expression to convert the value # of the controlling PV which is available # as 'A' to the range 1..10 (or less if # less selections are used). # E.g., to convert the value of a bo (0/1) # you would set mapc to 'A+1' (0..1 -> 1..2) # # NOTE: This sb snippet is loaded/expanded # for every parameter under control # of $[ctrl]. ALSO, the companion # snippet parmCtl.db must be loaded/expanded # but only once per controlling PV. # # This record, when scanned (as a result # of $[parm] being written and processing # its FLNK to this record] fetches $[parm] # and deposits the value into the currently # selected field of the SEL record. # # NOTE: unfortunately, the selection # mechanism of the SEQ and SEL # records differs: SEQ is 1-based, # SEL is 0-based -- now that makes # sense, doesn't it? # record(seq, "HL2:SBPM:HL37:UOFF_SEQ") { field(DESC, "Propagate Parm -> SEL") field(DOL1, "HL2:SBPM:HL37:UOFF") field(DOL2, "HL2:SBPM:HL37:UOFF") field(DOL3, "HL2:SBPM:HL37:UOFF") field(DOL4, "HL2:SBPM:HL37:UOFF") field(DOL5, "HL2:SBPM:HL37:UOFF") field(DOL6, "HL2:SBPM:HL37:UOFF") field(DOL7, "HL2:SBPM:HL37:UOFF") field(DOL8, "HL2:SBPM:HL37:UOFF") field(DOL9, "HL2:SBPM:HL37:UOFF") field(DOLA, "HL2:SBPM:HL37:UOFF") field(LNK1, "HL2:SBPM:HL37:UOFF_SEL.A PP") field(LNK2, "HL2:SBPM:HL37:UOFF_SEL.B PP") field(LNK3, "HL2:SBPM:HL37:UOFF_SEL.C PP") field(LNK4, "HL2:SBPM:HL37:UOFF_SEL.D PP") field(LNK5, "HL2:SBPM:HL37:UOFF_SEL.E PP") field(LNK6, "HL2:SBPM:HL37:UOFF_SEL.F PP") field(LNK7, "HL2:SBPM:HL37:UOFF_SEL.G PP") field(LNK8, "HL2:SBPM:HL37:UOFF_SEL.H PP") field(LNK9, "HL2:SBPM:HL37:UOFF_SEL.I PP") field(LNKA, "HL2:SBPM:HL37:UOFF_SEL.J PP") field(SELM, "Specified") field(SELL, "HL2:SBPM:HL37:UOFF_CTRL NPP NMS") } # The $[parm]_SEL record holds all possible # values of $[parm] in the 'A..J' fields. # # When processed it updates it's own VAL # to the currently selected input. Input # 'L' serves as the (1-based) selector, # i.e., L==1 selects 'A'->'VAL'. # # When the selected value changes (as a # result of SEQ depositing a new value OR # $[ctrl] changing and updating L) then # the propagator record attached to the # FLNK is processed. # record(sub, "HL2:SBPM:HL37:UOFF_SEL") { # field(INAM, "parmSelSubInit") field(SNAM, "parmSelSubProc") field(A, "0") field(B, "0") field(C, "") field(D, "") field(E, "") field(F, "") field(G, "") field(H, "") field(I, "") field(J, "") field(PREC, "4") field(FLNK, "HL2:SBPM:HL37:UOFF_PROP") info(autosaveFields, "A B C D E F G H I J") } # # Finally the dfanout record # fetches the currently selected # value from SEL and propagates it # to $[outl]. It also updates # $[parm] itself so that $[parm] # always reflects the currently # selected value. # record(dfanout, "HL2:SBPM:HL37:UOFF_PROP") { field(OMSL, "closed_loop") field(DOL, "HL2:SBPM:HL37:UOFF_SEL") field(OUTA, "HL2:SBPM:HL37:U.AOFF CA") field(OUTB, "HL2:SBPM:HL37:UOFF PP") } # Drive the SEL record when the 'ctrl' PV changes # Use a CA link to monitor such changes record(calcout, "HL2:SBPM:HL37:UOFF_CTRL") { field(INPA, "HL2:SBPM:HL37:PARMSEL CP") field(CALC, "A+1") field(DOPT, "Use CALC") field(OOPT, "On Change") field(OUT, "HL2:SBPM:HL37:UOFF_SEL.L PP") } # Maintain multiple (up to 10) values of # a parameter: # # Record holding the parameter $[parm] # must FLNK -> $[parm]_SEQ # # Different values of the parameter # $[parm0]..$[parm9] are stored in # $[parm]_SEL.A .. $[parm]_SEL.J # # The actual value of the parameter is # selected based on the value of a controlling # PV $[ctrl] using a 'mapping' CALC expression # $[mapc] to convert the $[ctrl] value into # the integer range 1..10. # # The selected value of $[parm] is written # to output link $[outl] # # A) When the user writes $[parm] then # its value is deposited in the currently # selected field of $[parm]_SEL and # propagated to $[outl] # # B) When the user writes any of $[parm]_SEL.A..J # then the value is stored there. If she # writes to the currently 'active' field\ # (as selected by $[ctrl]) then # the $[parm] PV itself is updated and the # value is also propagated to $[outl] # # C) If the user changes $[ctrl] then the # corresponding value $[parm]_SEL.A..J is # propagated to $[outl] and $[parm]. # # D) At initialization, the value corresponding # to the initial setting of $[ctrl] is written # to $[outl] and $[parm] # # MACROS: # # $[parm] PV holding the parameter # $[ctrl] PV that controls the selection of # the currently active setting of # $[parm] # $[outl] PV where the currently selected # value of $[parm] shall be written-to # (if applicable) # $[prec] Precision of the $[parm]_SEL variable # (should be set to same value as $[parm].PREC) # # $[parm0]..$[parm9] initial values of $[parm] # # $[mapc] CALC expression to convert the value # of the controlling PV which is available # as 'A' to the range 1..10 (or less if # less selections are used). # E.g., to convert the value of a bo (0/1) # you would set mapc to 'A+1' (0..1 -> 1..2) # # NOTE: This sb snippet is loaded/expanded # for every parameter under control # of $[ctrl]. ALSO, the companion # snippet parmCtl.db must be loaded/expanded # but only once per controlling PV. # # This record, when scanned (as a result # of $[parm] being written and processing # its FLNK to this record] fetches $[parm] # and deposits the value into the currently # selected field of the SEL record. # # NOTE: unfortunately, the selection # mechanism of the SEQ and SEL # records differs: SEQ is 1-based, # SEL is 0-based -- now that makes # sense, doesn't it? # record(seq, "HL2:SBPM:HL37:VOFF_SEQ") { field(DESC, "Propagate Parm -> SEL") field(DOL1, "HL2:SBPM:HL37:VOFF") field(DOL2, "HL2:SBPM:HL37:VOFF") field(DOL3, "HL2:SBPM:HL37:VOFF") field(DOL4, "HL2:SBPM:HL37:VOFF") field(DOL5, "HL2:SBPM:HL37:VOFF") field(DOL6, "HL2:SBPM:HL37:VOFF") field(DOL7, "HL2:SBPM:HL37:VOFF") field(DOL8, "HL2:SBPM:HL37:VOFF") field(DOL9, "HL2:SBPM:HL37:VOFF") field(DOLA, "HL2:SBPM:HL37:VOFF") field(LNK1, "HL2:SBPM:HL37:VOFF_SEL.A PP") field(LNK2, "HL2:SBPM:HL37:VOFF_SEL.B PP") field(LNK3, "HL2:SBPM:HL37:VOFF_SEL.C PP") field(LNK4, "HL2:SBPM:HL37:VOFF_SEL.D PP") field(LNK5, "HL2:SBPM:HL37:VOFF_SEL.E PP") field(LNK6, "HL2:SBPM:HL37:VOFF_SEL.F PP") field(LNK7, "HL2:SBPM:HL37:VOFF_SEL.G PP") field(LNK8, "HL2:SBPM:HL37:VOFF_SEL.H PP") field(LNK9, "HL2:SBPM:HL37:VOFF_SEL.I PP") field(LNKA, "HL2:SBPM:HL37:VOFF_SEL.J PP") field(SELM, "Specified") field(SELL, "HL2:SBPM:HL37:VOFF_CTRL NPP NMS") } # The $[parm]_SEL record holds all possible # values of $[parm] in the 'A..J' fields. # # When processed it updates it's own VAL # to the currently selected input. Input # 'L' serves as the (1-based) selector, # i.e., L==1 selects 'A'->'VAL'. # # When the selected value changes (as a # result of SEQ depositing a new value OR # $[ctrl] changing and updating L) then # the propagator record attached to the # FLNK is processed. # record(sub, "HL2:SBPM:HL37:VOFF_SEL") { # field(INAM, "parmSelSubInit") field(SNAM, "parmSelSubProc") field(A, "0") field(B, "0") field(C, "") field(D, "") field(E, "") field(F, "") field(G, "") field(H, "") field(I, "") field(J, "") field(PREC, "4") field(FLNK, "HL2:SBPM:HL37:VOFF_PROP") info(autosaveFields, "A B C D E F G H I J") } # # Finally the dfanout record # fetches the currently selected # value from SEL and propagates it # to $[outl]. It also updates # $[parm] itself so that $[parm] # always reflects the currently # selected value. # record(dfanout, "HL2:SBPM:HL37:VOFF_PROP") { field(OMSL, "closed_loop") field(DOL, "HL2:SBPM:HL37:VOFF_SEL") field(OUTA, "HL2:SBPM:HL37:V.AOFF CA") field(OUTB, "HL2:SBPM:HL37:VOFF PP") } # Drive the SEL record when the 'ctrl' PV changes # Use a CA link to monitor such changes record(calcout, "HL2:SBPM:HL37:VOFF_CTRL") { field(INPA, "HL2:SBPM:HL37:PARMSEL CP") field(CALC, "A+1") field(DOPT, "Use CALC") field(OOPT, "On Change") field(OUT, "HL2:SBPM:HL37:VOFF_SEL.L PP") } # Maintain multiple (up to 10) values of # a parameter: # # Record holding the parameter $[parm] # must FLNK -> $[parm]_SEQ # # Different values of the parameter # $[parm0]..$[parm9] are stored in # $[parm]_SEL.A .. $[parm]_SEL.J # # The actual value of the parameter is # selected based on the value of a controlling # PV $[ctrl] using a 'mapping' CALC expression # $[mapc] to convert the $[ctrl] value into # the integer range 1..10. # # The selected value of $[parm] is written # to output link $[outl] # # A) When the user writes $[parm] then # its value is deposited in the currently # selected field of $[parm]_SEL and # propagated to $[outl] # # B) When the user writes any of $[parm]_SEL.A..J # then the value is stored there. If she # writes to the currently 'active' field\ # (as selected by $[ctrl]) then # the $[parm] PV itself is updated and the # value is also propagated to $[outl] # # C) If the user changes $[ctrl] then the # corresponding value $[parm]_SEL.A..J is # propagated to $[outl] and $[parm]. # # D) At initialization, the value corresponding # to the initial setting of $[ctrl] is written # to $[outl] and $[parm] # # MACROS: # # $[parm] PV holding the parameter # $[ctrl] PV that controls the selection of # the currently active setting of # $[parm] # $[outl] PV where the currently selected # value of $[parm] shall be written-to # (if applicable) # $[prec] Precision of the $[parm]_SEL variable # (should be set to same value as $[parm].PREC) # # $[parm0]..$[parm9] initial values of $[parm] # # $[mapc] CALC expression to convert the value # of the controlling PV which is available # as 'A' to the range 1..10 (or less if # less selections are used). # E.g., to convert the value of a bo (0/1) # you would set mapc to 'A+1' (0..1 -> 1..2) # # NOTE: This sb snippet is loaded/expanded # for every parameter under control # of $[ctrl]. ALSO, the companion # snippet parmCtl.db must be loaded/expanded # but only once per controlling PV. # # This record, when scanned (as a result # of $[parm] being written and processing # its FLNK to this record] fetches $[parm] # and deposits the value into the currently # selected field of the SEL record. # # NOTE: unfortunately, the selection # mechanism of the SEQ and SEL # records differs: SEQ is 1-based, # SEL is 0-based -- now that makes # sense, doesn't it? # record(seq, "HL2:SBPM:HL37:USCL_SEQ") { field(DESC, "Propagate Parm -> SEL") field(DOL1, "HL2:SBPM:HL37:USCL") field(DOL2, "HL2:SBPM:HL37:USCL") field(DOL3, "HL2:SBPM:HL37:USCL") field(DOL4, "HL2:SBPM:HL37:USCL") field(DOL5, "HL2:SBPM:HL37:USCL") field(DOL6, "HL2:SBPM:HL37:USCL") field(DOL7, "HL2:SBPM:HL37:USCL") field(DOL8, "HL2:SBPM:HL37:USCL") field(DOL9, "HL2:SBPM:HL37:USCL") field(DOLA, "HL2:SBPM:HL37:USCL") field(LNK1, "HL2:SBPM:HL37:USCL_SEL.A PP") field(LNK2, "HL2:SBPM:HL37:USCL_SEL.B PP") field(LNK3, "HL2:SBPM:HL37:USCL_SEL.C PP") field(LNK4, "HL2:SBPM:HL37:USCL_SEL.D PP") field(LNK5, "HL2:SBPM:HL37:USCL_SEL.E PP") field(LNK6, "HL2:SBPM:HL37:USCL_SEL.F PP") field(LNK7, "HL2:SBPM:HL37:USCL_SEL.G PP") field(LNK8, "HL2:SBPM:HL37:USCL_SEL.H PP") field(LNK9, "HL2:SBPM:HL37:USCL_SEL.I PP") field(LNKA, "HL2:SBPM:HL37:USCL_SEL.J PP") field(SELM, "Specified") field(SELL, "HL2:SBPM:HL37:USCL_CTRL NPP NMS") } # The $[parm]_SEL record holds all possible # values of $[parm] in the 'A..J' fields. # # When processed it updates it's own VAL # to the currently selected input. Input # 'L' serves as the (1-based) selector, # i.e., L==1 selects 'A'->'VAL'. # # When the selected value changes (as a # result of SEQ depositing a new value OR # $[ctrl] changing and updating L) then # the propagator record attached to the # FLNK is processed. # record(sub, "HL2:SBPM:HL37:USCL_SEL") { # field(INAM, "parmSelSubInit") field(SNAM, "parmSelSubProc") field(A, "1") field(B, "1") field(C, "") field(D, "") field(E, "") field(F, "") field(G, "") field(H, "") field(I, "") field(J, "") field(PREC, "4") field(FLNK, "HL2:SBPM:HL37:USCL_PROP") info(autosaveFields, "A B C D E F G H I J") } # # Finally the dfanout record # fetches the currently selected # value from SEL and propagates it # to $[outl]. It also updates # $[parm] itself so that $[parm] # always reflects the currently # selected value. # record(dfanout, "HL2:SBPM:HL37:USCL_PROP") { field(OMSL, "closed_loop") field(DOL, "HL2:SBPM:HL37:USCL_SEL") field(OUTA, "HL2:SBPM:HL37:U.ASLO CA") field(OUTB, "HL2:SBPM:HL37:USCL PP") } # Drive the SEL record when the 'ctrl' PV changes # Use a CA link to monitor such changes record(calcout, "HL2:SBPM:HL37:USCL_CTRL") { field(INPA, "HL2:SBPM:HL37:PARMSEL CP") field(CALC, "A+1") field(DOPT, "Use CALC") field(OOPT, "On Change") field(OUT, "HL2:SBPM:HL37:USCL_SEL.L PP") } # Maintain multiple (up to 10) values of # a parameter: # # Record holding the parameter $[parm] # must FLNK -> $[parm]_SEQ # # Different values of the parameter # $[parm0]..$[parm9] are stored in # $[parm]_SEL.A .. $[parm]_SEL.J # # The actual value of the parameter is # selected based on the value of a controlling # PV $[ctrl] using a 'mapping' CALC expression # $[mapc] to convert the $[ctrl] value into # the integer range 1..10. # # The selected value of $[parm] is written # to output link $[outl] # # A) When the user writes $[parm] then # its value is deposited in the currently # selected field of $[parm]_SEL and # propagated to $[outl] # # B) When the user writes any of $[parm]_SEL.A..J # then the value is stored there. If she # writes to the currently 'active' field\ # (as selected by $[ctrl]) then # the $[parm] PV itself is updated and the # value is also propagated to $[outl] # # C) If the user changes $[ctrl] then the # corresponding value $[parm]_SEL.A..J is # propagated to $[outl] and $[parm]. # # D) At initialization, the value corresponding # to the initial setting of $[ctrl] is written # to $[outl] and $[parm] # # MACROS: # # $[parm] PV holding the parameter # $[ctrl] PV that controls the selection of # the currently active setting of # $[parm] # $[outl] PV where the currently selected # value of $[parm] shall be written-to # (if applicable) # $[prec] Precision of the $[parm]_SEL variable # (should be set to same value as $[parm].PREC) # # $[parm0]..$[parm9] initial values of $[parm] # # $[mapc] CALC expression to convert the value # of the controlling PV which is available # as 'A' to the range 1..10 (or less if # less selections are used). # E.g., to convert the value of a bo (0/1) # you would set mapc to 'A+1' (0..1 -> 1..2) # # NOTE: This sb snippet is loaded/expanded # for every parameter under control # of $[ctrl]. ALSO, the companion # snippet parmCtl.db must be loaded/expanded # but only once per controlling PV. # # This record, when scanned (as a result # of $[parm] being written and processing # its FLNK to this record] fetches $[parm] # and deposits the value into the currently # selected field of the SEL record. # # NOTE: unfortunately, the selection # mechanism of the SEQ and SEL # records differs: SEQ is 1-based, # SEL is 0-based -- now that makes # sense, doesn't it? # record(seq, "HL2:SBPM:HL37:VSCL_SEQ") { field(DESC, "Propagate Parm -> SEL") field(DOL1, "HL2:SBPM:HL37:VSCL") field(DOL2, "HL2:SBPM:HL37:VSCL") field(DOL3, "HL2:SBPM:HL37:VSCL") field(DOL4, "HL2:SBPM:HL37:VSCL") field(DOL5, "HL2:SBPM:HL37:VSCL") field(DOL6, "HL2:SBPM:HL37:VSCL") field(DOL7, "HL2:SBPM:HL37:VSCL") field(DOL8, "HL2:SBPM:HL37:VSCL") field(DOL9, "HL2:SBPM:HL37:VSCL") field(DOLA, "HL2:SBPM:HL37:VSCL") field(LNK1, "HL2:SBPM:HL37:VSCL_SEL.A PP") field(LNK2, "HL2:SBPM:HL37:VSCL_SEL.B PP") field(LNK3, "HL2:SBPM:HL37:VSCL_SEL.C PP") field(LNK4, "HL2:SBPM:HL37:VSCL_SEL.D PP") field(LNK5, "HL2:SBPM:HL37:VSCL_SEL.E PP") field(LNK6, "HL2:SBPM:HL37:VSCL_SEL.F PP") field(LNK7, "HL2:SBPM:HL37:VSCL_SEL.G PP") field(LNK8, "HL2:SBPM:HL37:VSCL_SEL.H PP") field(LNK9, "HL2:SBPM:HL37:VSCL_SEL.I PP") field(LNKA, "HL2:SBPM:HL37:VSCL_SEL.J PP") field(SELM, "Specified") field(SELL, "HL2:SBPM:HL37:VSCL_CTRL NPP NMS") } # The $[parm]_SEL record holds all possible # values of $[parm] in the 'A..J' fields. # # When processed it updates it's own VAL # to the currently selected input. Input # 'L' serves as the (1-based) selector, # i.e., L==1 selects 'A'->'VAL'. # # When the selected value changes (as a # result of SEQ depositing a new value OR # $[ctrl] changing and updating L) then # the propagator record attached to the # FLNK is processed. # record(sub, "HL2:SBPM:HL37:VSCL_SEL") { # field(INAM, "parmSelSubInit") field(SNAM, "parmSelSubProc") field(A, "1") field(B, "1") field(C, "") field(D, "") field(E, "") field(F, "") field(G, "") field(H, "") field(I, "") field(J, "") field(PREC, "4") field(FLNK, "HL2:SBPM:HL37:VSCL_PROP") info(autosaveFields, "A B C D E F G H I J") } # # Finally the dfanout record # fetches the currently selected # value from SEL and propagates it # to $[outl]. It also updates # $[parm] itself so that $[parm] # always reflects the currently # selected value. # record(dfanout, "HL2:SBPM:HL37:VSCL_PROP") { field(OMSL, "closed_loop") field(DOL, "HL2:SBPM:HL37:VSCL_SEL") field(OUTA, "HL2:SBPM:HL37:V.ASLO CA") field(OUTB, "HL2:SBPM:HL37:VSCL PP") } # Drive the SEL record when the 'ctrl' PV changes # Use a CA link to monitor such changes record(calcout, "HL2:SBPM:HL37:VSCL_CTRL") { field(INPA, "HL2:SBPM:HL37:PARMSEL CP") field(CALC, "A+1") field(DOPT, "Use CALC") field(OOPT, "On Change") field(OUT, "HL2:SBPM:HL37:VSCL_SEL.L PP") } # Maintain multiple (up to 10) values of # a parameter: # # Record holding the parameter $[parm] # must FLNK -> $[parm]_SEQ # # Different values of the parameter # $[parm0]..$[parm9] are stored in # $[parm]_SEL.A .. $[parm]_SEL.J # # The actual value of the parameter is # selected based on the value of a controlling # PV $[ctrl] using a 'mapping' CALC expression # $[mapc] to convert the $[ctrl] value into # the integer range 1..10. # # The selected value of $[parm] is written # to output link $[outl] # # A) When the user writes $[parm] then # its value is deposited in the currently # selected field of $[parm]_SEL and # propagated to $[outl] # # B) When the user writes any of $[parm]_SEL.A..J # then the value is stored there. If she # writes to the currently 'active' field\ # (as selected by $[ctrl]) then # the $[parm] PV itself is updated and the # value is also propagated to $[outl] # # C) If the user changes $[ctrl] then the # corresponding value $[parm]_SEL.A..J is # propagated to $[outl] and $[parm]. # # D) At initialization, the value corresponding # to the initial setting of $[ctrl] is written # to $[outl] and $[parm] # # MACROS: # # $[parm] PV holding the parameter # $[ctrl] PV that controls the selection of # the currently active setting of # $[parm] # $[outl] PV where the currently selected # value of $[parm] shall be written-to # (if applicable) # $[prec] Precision of the $[parm]_SEL variable # (should be set to same value as $[parm].PREC) # # $[parm0]..$[parm9] initial values of $[parm] # # $[mapc] CALC expression to convert the value # of the controlling PV which is available # as 'A' to the range 1..10 (or less if # less selections are used). # E.g., to convert the value of a bo (0/1) # you would set mapc to 'A+1' (0..1 -> 1..2) # # NOTE: This sb snippet is loaded/expanded # for every parameter under control # of $[ctrl]. ALSO, the companion # snippet parmCtl.db must be loaded/expanded # but only once per controlling PV. # # This record, when scanned (as a result # of $[parm] being written and processing # its FLNK to this record] fetches $[parm] # and deposits the value into the currently # selected field of the SEL record. # # NOTE: unfortunately, the selection # mechanism of the SEQ and SEL # records differs: SEQ is 1-based, # SEL is 0-based -- now that makes # sense, doesn't it? # record(seq, "HL2:SBPM:HL37:PHI_SEQ") { field(DESC, "Propagate Parm -> SEL") field(DOL1, "HL2:SBPM:HL37:PHI") field(DOL2, "HL2:SBPM:HL37:PHI") field(DOL3, "HL2:SBPM:HL37:PHI") field(DOL4, "HL2:SBPM:HL37:PHI") field(DOL5, "HL2:SBPM:HL37:PHI") field(DOL6, "HL2:SBPM:HL37:PHI") field(DOL7, "HL2:SBPM:HL37:PHI") field(DOL8, "HL2:SBPM:HL37:PHI") field(DOL9, "HL2:SBPM:HL37:PHI") field(DOLA, "HL2:SBPM:HL37:PHI") field(LNK1, "HL2:SBPM:HL37:PHI_SEL.A PP") field(LNK2, "HL2:SBPM:HL37:PHI_SEL.B PP") field(LNK3, "HL2:SBPM:HL37:PHI_SEL.C PP") field(LNK4, "HL2:SBPM:HL37:PHI_SEL.D PP") field(LNK5, "HL2:SBPM:HL37:PHI_SEL.E PP") field(LNK6, "HL2:SBPM:HL37:PHI_SEL.F PP") field(LNK7, "HL2:SBPM:HL37:PHI_SEL.G PP") field(LNK8, "HL2:SBPM:HL37:PHI_SEL.H PP") field(LNK9, "HL2:SBPM:HL37:PHI_SEL.I PP") field(LNKA, "HL2:SBPM:HL37:PHI_SEL.J PP") field(SELM, "Specified") field(SELL, "HL2:SBPM:HL37:PHI_CTRL NPP NMS") } # The $[parm]_SEL record holds all possible # values of $[parm] in the 'A..J' fields. # # When processed it updates it's own VAL # to the currently selected input. Input # 'L' serves as the (1-based) selector, # i.e., L==1 selects 'A'->'VAL'. # # When the selected value changes (as a # result of SEQ depositing a new value OR # $[ctrl] changing and updating L) then # the propagator record attached to the # FLNK is processed. # record(sub, "HL2:SBPM:HL37:PHI_SEL") { # field(INAM, "parmSelSubInit") field(SNAM, "parmSelSubProc") field(A, "0") field(B, "0") field(C, "") field(D, "") field(E, "") field(F, "") field(G, "") field(H, "") field(I, "") field(J, "") field(PREC, "1") field(FLNK, "HL2:SBPM:HL37:PHI_PROP") info(autosaveFields, "A B C D E F G H I J") } # # Finally the dfanout record # fetches the currently selected # value from SEL and propagates it # to $[outl]. It also updates # $[parm] itself so that $[parm] # always reflects the currently # selected value. # record(dfanout, "HL2:SBPM:HL37:PHI_PROP") { field(OMSL, "closed_loop") field(DOL, "HL2:SBPM:HL37:PHI_SEL") field(OUTA, "HL2:SBPM:HL37:CALC.E CA") field(OUTB, "HL2:SBPM:HL37:PHI PP") } # Drive the SEL record when the 'ctrl' PV changes # Use a CA link to monitor such changes record(calcout, "HL2:SBPM:HL37:PHI_CTRL") { field(INPA, "HL2:SBPM:HL37:PARMSEL CP") field(CALC, "A+1") field(DOPT, "Use CALC") field(OOPT, "On Change") field(OUT, "HL2:SBPM:HL37:PHI_SEL.L PP") } # Maintain multiple (up to 10) values of # a parameter: # # Record holding the parameter $[parm] # must FLNK -> $[parm]_SEQ # # Different values of the parameter # $[parm0]..$[parm9] are stored in # $[parm]_SEL.A .. $[parm]_SEL.J # # The actual value of the parameter is # selected based on the value of a controlling # PV $[ctrl] using a 'mapping' CALC expression # $[mapc] to convert the $[ctrl] value into # the integer range 1..10. # # The selected value of $[parm] is written # to output link $[outl] # # A) When the user writes $[parm] then # its value is deposited in the currently # selected field of $[parm]_SEL and # propagated to $[outl] # # B) When the user writes any of $[parm]_SEL.A..J # then the value is stored there. If she # writes to the currently 'active' field\ # (as selected by $[ctrl]) then # the $[parm] PV itself is updated and the # value is also propagated to $[outl] # # C) If the user changes $[ctrl] then the # corresponding value $[parm]_SEL.A..J is # propagated to $[outl] and $[parm]. # # D) At initialization, the value corresponding # to the initial setting of $[ctrl] is written # to $[outl] and $[parm] # # MACROS: # # $[parm] PV holding the parameter # $[ctrl] PV that controls the selection of # the currently active setting of # $[parm] # $[outl] PV where the currently selected # value of $[parm] shall be written-to # (if applicable) # $[prec] Precision of the $[parm]_SEL variable # (should be set to same value as $[parm].PREC) # # $[parm0]..$[parm9] initial values of $[parm] # # $[mapc] CALC expression to convert the value # of the controlling PV which is available # as 'A' to the range 1..10 (or less if # less selections are used). # E.g., to convert the value of a bo (0/1) # you would set mapc to 'A+1' (0..1 -> 1..2) # # NOTE: This sb snippet is loaded/expanded # for every parameter under control # of $[ctrl]. ALSO, the companion # snippet parmCtl.db must be loaded/expanded # but only once per controlling PV. # # This record, when scanned (as a result # of $[parm] being written and processing # its FLNK to this record] fetches $[parm] # and deposits the value into the currently # selected field of the SEL record. # # NOTE: unfortunately, the selection # mechanism of the SEQ and SEL # records differs: SEQ is 1-based, # SEL is 0-based -- now that makes # sense, doesn't it? # record(seq, "HL2:SBPM:HL37:PSI_SEQ") { field(DESC, "Propagate Parm -> SEL") field(DOL1, "HL2:SBPM:HL37:PSI") field(DOL2, "HL2:SBPM:HL37:PSI") field(DOL3, "HL2:SBPM:HL37:PSI") field(DOL4, "HL2:SBPM:HL37:PSI") field(DOL5, "HL2:SBPM:HL37:PSI") field(DOL6, "HL2:SBPM:HL37:PSI") field(DOL7, "HL2:SBPM:HL37:PSI") field(DOL8, "HL2:SBPM:HL37:PSI") field(DOL9, "HL2:SBPM:HL37:PSI") field(DOLA, "HL2:SBPM:HL37:PSI") field(LNK1, "HL2:SBPM:HL37:PSI_SEL.A PP") field(LNK2, "HL2:SBPM:HL37:PSI_SEL.B PP") field(LNK3, "HL2:SBPM:HL37:PSI_SEL.C PP") field(LNK4, "HL2:SBPM:HL37:PSI_SEL.D PP") field(LNK5, "HL2:SBPM:HL37:PSI_SEL.E PP") field(LNK6, "HL2:SBPM:HL37:PSI_SEL.F PP") field(LNK7, "HL2:SBPM:HL37:PSI_SEL.G PP") field(LNK8, "HL2:SBPM:HL37:PSI_SEL.H PP") field(LNK9, "HL2:SBPM:HL37:PSI_SEL.I PP") field(LNKA, "HL2:SBPM:HL37:PSI_SEL.J PP") field(SELM, "Specified") field(SELL, "HL2:SBPM:HL37:PSI_CTRL NPP NMS") } # The $[parm]_SEL record holds all possible # values of $[parm] in the 'A..J' fields. # # When processed it updates it's own VAL # to the currently selected input. Input # 'L' serves as the (1-based) selector, # i.e., L==1 selects 'A'->'VAL'. # # When the selected value changes (as a # result of SEQ depositing a new value OR # $[ctrl] changing and updating L) then # the propagator record attached to the # FLNK is processed. # record(sub, "HL2:SBPM:HL37:PSI_SEL") { # field(INAM, "parmSelSubInit") field(SNAM, "parmSelSubProc") field(A, "90") field(B, "90") field(C, "") field(D, "") field(E, "") field(F, "") field(G, "") field(H, "") field(I, "") field(J, "") field(PREC, "1") field(FLNK, "HL2:SBPM:HL37:PSI_PROP") info(autosaveFields, "A B C D E F G H I J") } # # Finally the dfanout record # fetches the currently selected # value from SEL and propagates it # to $[outl]. It also updates # $[parm] itself so that $[parm] # always reflects the currently # selected value. # record(dfanout, "HL2:SBPM:HL37:PSI_PROP") { field(OMSL, "closed_loop") field(DOL, "HL2:SBPM:HL37:PSI_SEL") field(OUTA, "HL2:SBPM:HL37:CALC.F CA") field(OUTB, "HL2:SBPM:HL37:PSI PP") } # Drive the SEL record when the 'ctrl' PV changes # Use a CA link to monitor such changes record(calcout, "HL2:SBPM:HL37:PSI_CTRL") { field(INPA, "HL2:SBPM:HL37:PARMSEL CP") field(CALC, "A+1") field(DOPT, "Use CALC") field(OOPT, "On Change") field(OUT, "HL2:SBPM:HL37:PSI_SEL.L PP") } record(longout, "HL2:SBPM:HL37:PARMSEL") { field(VAL, "0") field(PINI, "YES") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBDEND # per BPM database for stripline BPMs ############################################## # This is the head of the main processing chain # that runs at the highest priority. ############################################## ############################################# # This is the head of the processing chain for # diagnostics. ############################################## record(ai, "HL2:SBPM:HL38:GRN") { field(DESC, "GRN Strip Amplitude") field(DTYP, "Raw Bpm Signal") # 'card' selects PAD number, 'signal' selects strip field(INP, "#C2 S0") field(EGU, "raw") #TODO set HOPR/LOPR, alarm limits field(SCAN, "I/O Intr") # The priority determines what scan list we are being # put on (see drvPadUdpComm.c) field(PRIO, "LOW") field(FLNK, "HL2:SBPM:HL38:RED") # HOPR for the energy algorithm is determined as follows: # # inf inf # 1) Fourier relation / h^2 dt = / |H|^2 df = 2 B # 0 -inf # # 1a) It can be shown that the maximum of the impuls response # ha is ~ 2 B # # 2) The digitizer produces the numbers # # Ai = 2^s (hi/ha) # # where ha is the maximum of the impuls response # and 2^s is a scale factor. # # 3) 'Energy algorithm' calculates S = sum( Ai^2 ) # # inf # 4) S = (2^s / ha)^2 sum(hi^2) = K sum(hi^2) Dt ~ K / h^2 dt # 0 # # with K = (2^s / ha)^2 fs # # 5) From 4) and 1a) -> S ~ K ha and therefore # # 6) S = 2^(2s) fs/ha = 2^(2s) fs/(2 B) # # 7) The strip signals are sqrt(S); hence HOPR is about # # HOPR ~ 2^s sqrt( fs/2/B ) # # with 2^s = 32768, fs=120MHz, B=10MHz it follows # that HOPR ~ 1E5; we add some margin... field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(ai, "HL2:SBPM:HL38:RED") { field(DESC, "RED Strip Amplitude") field(DTYP, "Raw Bpm Signal") # 'card' selects PAD number, 'signal' selects strip field(INP, "#C2 S1") field(EGU, "raw") field(SCAN, "Passive") field(FLNK, "HL2:SBPM:HL38:BLU") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(ai, "HL2:SBPM:HL38:BLU") { field(DESC, "BLU Strip Amplitude") field(DTYP, "Raw Bpm Signal") # 'card' selects PAD number, 'signal' selects strip field(INP, "#C2 S2") field(EGU, "raw") field(SCAN, "Passive") field(FLNK, "HL2:SBPM:HL38:YLO") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(ai, "HL2:SBPM:HL38:YLO") { field(DESC, "YLO Strip Amplitude") field(DTYP, "Raw Bpm Signal") # 'card' selects PAD number, 'signal' selects strip field(INP, "#C2 S3") field(EGU, "raw") field(SCAN, "Passive") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } ############################################## # Slowly-scanned diagnostics ############################################## # record(waveform, "HL2:SBPM:HL38:REDW") { field(DESC, "Raw CAL RED Data") field(DTYP, "WavBuf") # 'signal' number selects 'beam', 'calX', 'calY' field(INP, "#C2 S1") field(NELM, "512") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32768") field(LOPR, "-32767") field(SCAN, "1 second") } record(waveform, "HL2:SBPM:HL38:GRNW") { field(DESC, "Raw CAL GRN Data") field(DTYP, "WavBuf") # 'signal' number selects 'beam', 'calX', 'calY' field(INP, "#C2 S2") field(NELM, "512") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32768") field(LOPR, "-32767") field(SCAN, "1 second") } record(waveform, "HL2:SBPM:HL38:RAWDBG") { field(DESC, "Raw BEAM Dbg") field(DTYP, "WavBuf") # 'signal' number selects 'beam', 'calX', 'calY' # do not 'wbscan' for now since e.g., an underrange # condition on the real signal can happen. field(INP, "#C2 S7") field(NELM, "512") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32768") field(LOPR, "-32767") field(SCAN, "Passive") } record(waveform, "HL2:SBPM:HL38:REDDBG") { field(DESC, "Raw CAL RED Dbg") field(DTYP, "WavBuf") # 'signal' number selects 'beam', 'calX', 'calY' field(INP, "#C2 S8 @wbscan") field(NELM, "512") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32768") field(LOPR, "-32767") field(SCAN, "Passive") } record(waveform, "HL2:SBPM:HL38:GRNDBG") { field(DESC, "Raw CAL GRN Dbg") field(DTYP, "WavBuf") # 'signal' number selects 'beam', 'calX', 'calY' field(INP, "#C2 S9 @wbscan") field(NELM, "512") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32768") field(LOPR, "-32767") field(SCAN, "Passive") } record(ai, "HL2:SBPM:HL38:GRUV") { field(DESC, "CAL Gain GRN/RED") field(DTYP, "Raw Stripl Calp") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C2 S0") field(SCAN, "10 second") field(PREC, "4") field(LOPR, "0.5") field(HOPR, "1.5") } record(ai, "HL2:SBPM:HL38:GRU") { field(DESC, "CAL Gain GRN/BLU") field(DTYP, "Raw Stripl Calp") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C2 S1") field(SCAN, "10 second") field(PREC, "4") field(LOPR, "0.5") field(HOPR, "1.5") info(autosaveFields, "ASLO") } record(ai, "HL2:SBPM:HL38:GRV") { field(DESC, "CAL Gain RED/YLO") field(DTYP, "Raw Stripl Calp") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C2 S2") field(SCAN, "10 second") field(PREC, "4") field(LOPR, "0.5") field(HOPR, "1.5") info(autosaveFields, "ASLO") } record(ai, "HL2:SBPM:HL38:TGRN") { field(DESC, "Green arrival time") field(DTYP, "Raw Bpm Signal") field(EGU, "ADC Clocks") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C2 S4") field(SCAN, "10 second") field(PREC, "1") field(LOPR, "0") field(HOPR, "128") field(LOLO, "5") field(LOW, "8") field(HIGH, "60") field(HIHI, "70") field(LLSV, "MAJOR") field(LSV, "MINOR") field(HSV, "MINOR") field(HHSV, "MAJOR") } record(ai, "HL2:SBPM:HL38:TRED") { field(DESC, "Red arrival time") field(DTYP, "Raw Bpm Signal") field(EGU, "ADC Clocks") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C2 S5") field(SCAN, "10 second") field(PREC, "1") field(LOPR, "0") field(HOPR, "128") field(LOLO, "5") field(LOW, "8") field(HIGH, "60") field(HIHI, "70") field(LLSV, "MAJOR") field(LSV, "MINOR") field(HSV, "MINOR") field(HHSV, "MAJOR") } record(ai, "HL2:SBPM:HL38:TBLU") { field(DESC, "Blue arrival time") field(DTYP, "Raw Bpm Signal") field(EGU, "ADC Clocks") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C2 S6") field(SCAN, "10 second") field(PREC, "1") field(LOPR, "0") field(HOPR, "128") field(LOLO, "5") field(LOW, "8") field(HIGH, "60") field(HIHI, "70") field(LLSV, "MAJOR") field(LSV, "MINOR") field(HSV, "MINOR") field(HHSV, "MAJOR") } record(ai, "HL2:SBPM:HL38:TYLO") { field(DESC, "Yellow arrival time") field(DTYP, "Raw Bpm Signal") field(EGU, "ADC Clocks") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C2 S7") field(SCAN, "10 second") field(PREC, "1") field(LOPR, "0") field(HOPR, "128") field(LOLO, "5") field(LOW, "8") field(HIGH, "60") field(HIHI, "70") field(LLSV, "MAJOR") field(LSV, "MINOR") field(HSV, "MINOR") field(HHSV, "MAJOR") } record(ao, "HL2:SBPM:HL38:PINC_ADJ") { field(DESC, "Adjust Pinc. Corr.") field(DTYP, "Soft Channel") field(OUT, "HL2:SBPM:HL38:CALC.K PP MS") field(VAL, "0") field(DRVL, "0") field(DRVH, "2") field(PINI, "YES") info(autosaveFields, "VAL") } # QSCL setting: # # Q: charge # Z: impedance # F: form factor: phi/(2 pi) sin(2 pi f l/c) # # Signal = Q Z F G h(t) = A h(t) [A] = Vs # # inf inf # Energy = A^2 / h^2(t) dt = A^2 / |H(w)|^2 dw/2/pi = A^2 B # 0 0 # # Measured energy = Sum{ (Vp/32768 * xi)^2 } / fs = S / fs ~ Energy # # -> A^2 B = S/fs # # With T = sqrt( Sum{ xi^2 } ) # # A = sqrt(S)/sqrt(B*fs) = T/sqrt(B*fs) Vp/32768 # # T/32768 Vp # Q = A/F/G/Z = ----------------- # F G Z sqrt(B*fs) # # Vp = { 1.5Vpp/2 (PGA=1) or 2.25Vpp/2 (PGA=0) } / 2 (transformer) # # I believe PGA is off (-> Vp ~ .56V) # # Z = 50 # # G: (calibration uses GRN/BLU -> signal should have the # level of the grn/red channels with the additional switch) # # Block diagram / parts / gain: # # [filt] [Att1] [Amp1] [Att2] [BPF] [Amp2] [pad] [Amp3] [switch] # f-17520 hmc540lp3 SBF-5089 hmc540lp3 MBP-140-6-4 SBF-4089 PAT-0 SBF-4089 HMC-197 # # -2dB* -1dB 20dB -1dB -4.5 14.8dB 0dB 14.8dB -0.4dB # # *: 1st filter ATT is a wild guess. # BPF loss (RLC Catalog, pp.55): (L (nsect+.5) / (% of 3dB BW) + .2) dB # with L ~6.2 10MHz/fc=140Mhz filter-> 4.5 # # -> Gtot ~ 40.7dB # # subtract cable loss (2dB); Gtot = 86 # # T/32768 Vp .56V/32768 # Q = A/F/G/Z = ----------------- = T/F ------------------------ # F G Z sqrt(B*fs) 86*50*sqrt(10*140)Mhz # # = T/F = 1.06E-7/F nC # # F for a 7% coverage, 4" BPM at 140MHz .07 sin(2*pi*140e6 4*.0254/3e8) # = .021 # # => 1.06E-7/.021 nC = 5E-6 nC # # (Faraday cup measurement -> (3600/44)^-1 1e-4 -> 1.22E-6 # record(ao, "HL2:SBPM:HL38:QSCL") { field(DESC, "TMIT/Charge Scale") field(DTYP, "Soft Channel") field(OUT, "HL2:SBPM:HL38:QSCA.A PP MS") # 5.0E-6 / 1.6E-10 [nC/e-] field(VAL, "31250") field(EGU, "Nel") field(PREC, "3") field(PINI, "YES") info(autosaveFields, "VAL") } # Adjust TMIT scale for AFE attenuation record(calcout, "HL2:SBPM:HL38:QSCA") { field(DESC, "TMIT ATT Adj. Scale") field(INPB, "HL2:SBPM:HL38:ATT1 CP") field(INPC, "HL2:SBPM:HL38:ATT2 CP") field(CALC, "A*10^((B+C+D)/20)") # use CA link to deposit into TMIT.ASLO so # that TMIT is not forced into linkset # of this record field(OUT, "HL2:SBPM:HL38:TMIT.ASLO CA") field(EGU, "Nel") field(PREC, "3") info(autosaveFields, "D") } record(ao, "HL2:SBPM:HL38:ATT1SIMP") { field(DESC, "ATT1 Propagator") field(DTYP, "Soft Channel") field(DOL, "HL2:SBPM:HL38:ATT1 CP") field(OMSL, "closed_loop") field(OUT, "HL2:SBPM:HL38:ASIM.A PP") field(IVOA, "Set output to IVOV") field(IVOV, "0") field(EGU, "dB") } record(ao, "HL2:SBPM:HL38:ATT2SIMP") { field(DESC, "ATT2 Propagator") field(DTYP, "Soft Channel") field(DOL, "HL2:SBPM:HL38:ATT2 CP") field(OMSL, "closed_loop") field(OUT, "HL2:SBPM:HL38:ASIM.C PP") field(IVOA, "Set output to IVOV") field(IVOV, "0") field(EGU, "dB") } # Attenuate charge either by # real attenuator settings or # by fake ones. # If B, C >= 0 then their # values will be used instead # of ATT1, ATT2 record(calcout, "HL2:SBPM:HL38:ASIM") { field(DESC, "Q Simul Attenuator") field(DTYP, "Soft Channel") field(OUT, "HL2:SBPM:HL38:QSIM.ESLO PP") # ATT1SIM puts value into A # set to -1 to use real attenuator settings # and >=0 to use B instead field(B, "-1") # ATT2SIM puts value into C # set to -1 to use real attenuator settings # and >=0 to use D instead field(D, "-1") field(CALC, "10^(((B>=0?B:A)+(D>=0?D:C))/20)") field(PINI, "YES") } record(ao, "HL2:SBPM:HL38:WSIM") { field(DESC, "BPM W Simul.") field(DTYP, "Soft Channel") field(OUT, "HL2:SBPM:HL38:SIM.G PP") field(VAL, "0.07") field(EGU, "%") field(PINI, "YES") field(PREC, "3") field(LOPR, "0") field(HOPR, "0.25") } record(sel, "HL2:SBPM:HL38:STA") { field(DESC, "Status Summary") field(SELM, "High Signal") field(INPA, "HL2:SBPM:HL38:RSTA.SEVR MS NPP") field(INPB, "HL2:SBPM:HL38:TMIT.SEVR MS NPP") field(INPC, "HL2:SBPM:HL38:Y.SEVR MS NPP") field(INPD, "HL2:SBPM:HL38:X.SEVR MS NPP") field(INPE, "HL2:SBPM:HL38:TGRN.SEVR MS NPP") field(INPF, "HL2:SBPM:HL38:TRED.SEVR MS NPP") field(INPG, "HL2:SBPM:HL38:TBLU.SEVR MS NPP") field(INPH, "HL2:SBPM:HL38:TYLO.SEVR MS NPP") field(INPI, "HL2:SBPM:HL38:GRU.SEVR MS NPP") field(INPJ, "HL2:SBPM:HL38:GRV.SEVR MS NPP") field(SCAN, "1 second") } # This record really belongs on the # PAD IOC. We keep them here however # so we can save/restore. It is more # confusing but shouldn't matter from # an efficiency standpoint (they are # rarely changed). record(longout, "HL2:SBPM:HL38:ATTO") { field(DESC, "AFE Tot. Att. Offset") # fetched via inlink #field(OUT, "HL2:SBPM:HL38:ATTC.B PP") field(DRVL, "-10") field(DRVH, "30") field(LOPR, "-10") field(HOPR, "30") field(EGU, "dB") field(VAL, "0") field(PINI, "YES") info(autosaveFields, "VAL DRVH HOPR DRVL LOPR") } # This record really belongs on the # PAD IOC. We keep them here however # so we can save/restore. It is more # confusing but shouldn't matter from # an efficiency standpoint (they are # rarely changed). record(longout, "HL2:SBPM:HL38:CLAO") { field(DESC, "AFE Cal. Att. Offset") # fetched via inlink #field(OUT, "HL2:SBPM:HL38:ATTC.C PP") field(DRVL, "-20") field(DRVH, "20") field(LOPR, "-20") field(HOPR, "20") field(EGU, "dB") field(VAL, "40") field(PINI, "YES") info(autosaveFields, "VAL DRVH HOPR DRVL LOPR") } record(calc, "HL2:SBPM:HL38:STA_ALH") { field(DESC, "Status Summary") field(SCAN, "1 second") field(CALC, "0") field(INPA, "HL2:SBPM:HL38:RSTA_ALH.SEVR MS NPP") field(INPB, "HL2:SBPM:HL38:GRU.SEVR MS NPP") field(INPC, "HL2:SBPM:HL38:GRV.SEVR MS NPP") field(INPD, "HL2:SBPM:HL38:CHK.SEVR MS NPP") field(INPE, "") field(INPF, "HL2:SBPM:HL38:AFE_COMM.SEVR MS NPP") } # snapshot PV for the bpm values display record(ai, "HL2:SBPM:HL38:GRN_SLOW") { field(DESC, "GRN snapshot for display") field(INP, "HL2:SBPM:HL38:GRN NPP MS") field(EGU, "raw") field(SCAN, "1 second") field(FLNK, "HL2:SBPM:HL38:RED_SLOW") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(ai, "HL2:SBPM:HL38:RED_SLOW") { field(DESC, "RED snapshot for display") # 'card' selects PAD number, 'signal' selects strip field(INP, "HL2:SBPM:HL38:RED NPP MS") field(EGU, "raw") field(SCAN, "Passive") field(FLNK, "HL2:SBPM:HL38:BLU_SLOW") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(ai, "HL2:SBPM:HL38:BLU_SLOW") { field(DESC, "BLU snapshot for display") # 'card' selects PAD number, 'signal' selects strip field(INP, "HL2:SBPM:HL38:BLU NPP MS") field(EGU, "raw") field(SCAN, "Passive") field(FLNK, "HL2:SBPM:HL38:YLO_SLOW") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(ai, "HL2:SBPM:HL38:YLO_SLOW") { field(DESC, "YLO snapshot for display") field(INP, "HL2:SBPM:HL38:YLO NPP MS") field(EGU, "raw") field(SCAN, "Passive") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(sub, "HL2:SBPM:HL38:CALC") { field(SNAM, "drvBpmBvectSetupSub") # E: phi F: psi # BPM channel number in L field(INPL, "2") field(SCAN, "Passive") } record(bo, "HL2:SBPM:HL38:PINC_ENA") { field(DESC, "Simple Pincushion Alg") field(DTYP, "BusAddress") field(OUT, "#C0S2@drvBpmStriplPincEna,m32") field(MASK, "4") field(ZNAM, "DISABLED") field(ONAM, "ENABLED") field(VAL, "0") field(PINI, "YES") info(autosaveFields, "VAL") } record(ao, "HL2:SBPM:HL38:UDR_THRES") { field(DESC, "Detection Underrange Threshold") field(DTYP, "Bpm Parameters") field(OUT, "#C2S0") field(EGU, "ADC Ticks") field(DOL, "45.26") field(PINI, "YES") field(DRVL, "0") field(DRVH, "32767") info(autosaveFields, "VAL") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBDEND # per BPM database for stripline BPMs ###################################### # HEAD of main processing chain ###################################### record(ai, "HL2:SBPM:HL38:X") { field(DESC, "X Position") field(EGU, "mm") field(DTYP, "Raw Bpm Signal") field(INP, "#C2 S11") field(SCAN, "I/O Intr") # The priority determines what scan list we are being # put on (see drvPadUdpComm.c) field(PRIO, "HIGH") field(FLNK, "HL2:SBPM:HL38:Y") field(PREC, "4") field(LOPR, "-12") field(HOPR, "+12") field(ASG, "") field(TSE, "-2") info(autosaveFields, "ASLO LOLO LOW HIGH HIHI HHSV LLSV") } record(ai, "HL2:SBPM:HL38:Y") { field(DESC, "Y Position") field(EGU, "mm") field(DTYP, "Raw Bpm Signal") field(INP, "#C2 S12") field(FLNK, "HL2:SBPM:HL38:TMIT") field(PREC, "4") field(LOPR, "-12") field(HOPR, "+12") field(ASG, "") field(TSE, "-2") info(autosaveFields, "ASLO LOLO LOW HIGH HIHI HHSV LLSV") } record(ai, "HL2:SBPM:HL38:TMIT") { field(DESC, "Charge Estimate") field(DTYP, "Raw Bpm Signal") field(INP, "#C2 S13") field(EGU, "Nel") field(PREC, "3") field(LOPR, "0") field(HOPR, "1E11") # FLINK into BSA field(FLNK, "HL2:SBPM:HL38:EFX.PROC") field(ASG, "") field(TSE, "-2") info(autosaveFields, "LOLO LOW HIGH HIHI HHSV LLSV ") } ###################################### # HEAD of diagnostics processing chain ###################################### # leave RWAV in it's own lockset; don't FLNK # to 'U' & friends record(waveform, "HL2:SBPM:HL38:RWAV") { field(DESC, "Raw BPM Data") field(DTYP, "WavBuf") # 'signal' number selects 'beam', 'calX', 'calY' field(INP, "#C2 S0") field(SCAN, "I/O Intr") # use LOW or HIGH to end up on the 'diagnostic' # scan list (see drvPadUdpComm.c) field(PRIO, "LOW") field(NELM, "512") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32768") field(LOPR, "-32767") } record(ai, "HL2:SBPM:HL38:U") { field(DESC, "Raw U Position") field(DTYP, "Raw Bpm Signal") field(INP, "#C2 S8") field(SCAN, "I/O Intr") # use LOW or HIGH to end up on the 'diagnostic' # scan list (see drvPadUdpComm.c) field(PRIO, "LOW") field(PREC, "5") field(EGU, "mm") field(LOPR, "-0.7") field(HOPR, "+0.7") field(FLNK, "HL2:SBPM:HL38:V") } record(ai, "HL2:SBPM:HL38:V") { field(DESC, "Raw V Position") field(DTYP, "Raw Bpm Signal") field(INP, "#C2 S9") field(SCAN, "Passive") field(PREC, "5") field(EGU, "mm") field(LOPR, "-0.7") field(HOPR, "+0.7") field(FLNK, "HL2:SBPM:HL38:PINC") } record(ai, "HL2:SBPM:HL38:PINC") { field(DESC, "Pin Cushion Corr.") field(DTYP, "Raw Bpm Signal") field(INP, "#C2 S10") field(SCAN, "Passive") } record(longin, "HL2:SBPM:HL38:RSTA") { field(DESC, "Status of Raw Processor") field(DTYP, "Bpm Raw Status") field(INP, "#C2S0") field(SCAN, "1 second") field(LOLO, "-1") field(HIHI, "+1") field(HHSV, "INVALID") field(LLSV, "INVALID") field(FLNK, "HL2:SBPM:HL38:RSTA_ALH") } record(calc, "HL2:SBPM:HL38:RSTA_ALH") { field(CALC, "A & B") field(INPA, "HL2:SBPM:HL38:RSTA") field(INPB, "0x30F") field(HIHI, "1") field(LOLO, "-1") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(SCAN, "Passive") } ###################################### # Input/Parameteres ###################################### record(ao, "HL2:SBPM:HL38:PHI") { field(DESC, "Rot Angle") field(DTYP, "Soft Channel") field(VAL, "0") field(EGU, "deg") field(PREC, "1") field(LOPR, "-180") field(HOPR, "+180") field(FLNK, "HL2:SBPM:HL38:PHI_SEQ") } record(ao, "HL2:SBPM:HL38:PSI") { field(DESC, "Axis Sep. Angle") field(DTYP, "Soft Channel") field(VAL, "90") field(EGU, "deg") field(PREC, "1") field(LOPR, "0") field(HOPR, "+180") field(FLNK, "HL2:SBPM:HL38:PSI_SEQ") } #record(dfanout, "HL2:SBPM:HL38:PCMM") { # field(DESC, "BPM Scale") # field(OUTA, "HL2:SBPM:HL38:USCL PP MS") # field(OUTB, "HL2:SBPM:HL38:VSCL PP MS") # field(VAL, "12") # field(EGU, "mm") # field(PREC, "4") # field(LOPR, "5") # field(HOPR, "15") # field(PINI, "YES") #} record(ao, "HL2:SBPM:HL38:UOFF") { field(DESC, "BPM U Offset") field(DTYP, "Soft Channel") field(VAL, "0") field(EGU, "mm") field(PREC, "4") field(LOPR, "-5") field(HOPR, "+5") field(FLNK, "HL2:SBPM:HL38:UOFF_SEQ") } record(ao, "HL2:SBPM:HL38:VOFF") { field(DESC, "BPM V Offset") field(DTYP, "Soft Channel") field(VAL, "0") field(EGU, "mm") field(PREC, "4") field(LOPR, "-5") field(HOPR, "+5") field(FLNK, "HL2:SBPM:HL38:VOFF_SEQ") } record(ao, "HL2:SBPM:HL38:USCL") { field(DESC, "BPM U Scale") field(DTYP, "Soft Channel") field(VAL, "1") field(EGU, "mm") field(PREC, "4") field(FLNK, "HL2:SBPM:HL38:USCL_SEQ") } record(ao, "HL2:SBPM:HL38:VSCL") { field(DESC, "BPM V Scale") field(DTYP, "Soft Channel") field(VAL, "1") field(EGU, "mm") field(PREC, "4") field(FLNK, "HL2:SBPM:HL38:VSCL_SEQ") } record(mbbo, "HL2:SBPM:HL38:ACCESS") { field(DESC, "BPM On Line") field(DTYP, "StreamSwitch") field(OUT, "#C2 S0") field(ZRVL, "1") field(ZRST, "Running") field(ZRSV, "NO_ALARM") field(ONVL, "1") field(ONST, "Maintenance") field(ONSV, "MINOR") field(TWVL, "1") field(TWST, "Test") field(TWSV, "MINOR") field(THVL, "0") field(THST, "OFFLINE") field(THSV, "MAJOR") # set both, rval and val to get it right # regardless of whether devsup does conversion # or not. field(RVAL, "0") field(VAL, "0") field(PINI, "YES") field(FLNK, "HL2:SBPM:HL38:SIMOFF") info(autosaveFields, "RVAL") } # # 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, "HL2:SBPM:HL38:FBCK") { field(DESC, "Feedback State") field(PINI, "YES") field(OMSL, "supervisory") field(VAL, "0") field(ZRVL, "0") field(ONVL, "1") field(TWVL, "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") info(autosaveFields, "VAL") } # Convenience record holding the MAD name record(stringin, "HL2:SBPM:HL38:MADN") { field(DESC, "MAD Name") field(VAL, "SBPMHL38") field(PINI, "YES") } record(stringin, "SBPMHL38:NAME") { field(DESC, "BPM Name") field(VAL, "HL2:SBPM:HL38") field(PINI, "YES") } record(ai, "HL2:SBPM:HL38:X_SLOW") { #alias("HL2:SBPM:HL38:X1H") field(DESC, "X snapshot for display") field(EGU, "mm") field(INP, "HL2:SBPM:HL38:X MS") field(FLNK, "HL2:SBPM:HL38:Y_SLOW") field(PREC, "4") field(SCAN, "1 second") field(LOPR, "-12") field(HOPR, "+12") } record(ai, "HL2:SBPM:HL38:Y_SLOW") { #alias("HL2:SBPM:HL38:Y1H") field(DESC, "Y snapshot for display") field(EGU, "mm") field(INP, "HL2:SBPM:HL38:Y NPP MS") field(FLNK, "HL2:SBPM:HL38:TMIT_SLOW") field(PREC, "4") field(LOPR, "-12") field(HOPR, "+12") } record(ai, "HL2:SBPM:HL38:TMIT_SLOW") { #alias("HL2:SBPM:HL38:TMIT1H") field(DESC, "TMIT snapshot for display") field(INP, "HL2:SBPM:HL38:TMIT NPP MS") field(EGU, "Nel") field(PREC, "3") field(LOPR, "0") field(HOPR, "1E11") } ###################################### # Simulation Parameters + Control ###################################### # switch off simulation when going off-line record(calcout, "HL2:SBPM:HL38:SIMOFF") { field(DESC, "Sim Off Propagator") field(INPA, "HL2:SBPM:HL38:ACCESS.RVAL") field(CALC, "A") field(OCAL, "0") field(OOPT, "When Zero") field(DOPT, "Use OCAL") field(OUT, "HL2:SBPM:HL38:SIMC PP") } record(calcout, "HL2:SBPM:HL38:SIM") { field(DESC, "BPM Pos. Simulation") field(DTYP, "Strip Signal Simulator") field(OUT, "2") #CALC & VAL unused; the real calculation is done # in device support. The reason this is a # calcout rather than sub is that we want # to use the OUT link... field(CALC, "A") field(INPA, "HL2:SBPM:HL38:USCL") field(INPL, "0") } # Switch simulation record HL2:SBPM:HL38:SIMCSEQ moved to # bpmCavity.db.part and bpmStripl.db.part record(mbbo, "HL2:SBPM:HL38:SIMC") { field(DESC, "Stripl Sim Ctl") field(DTYP, "Raw Soft Channel") field(OUT, "HL2:SBPM:HL38:SIMCSEQ.SELN PP") field(ZRST, "OFF") field(ZRVL, "0x0f") field(ONST, "ON") field(ONVL, "0x1c0") field(TWST, "SOFT") field(TWVL, "0x030") field(MASK, "-1") field(NOBT, "16") field(VAL, "0") field(RVAL, "0x0f") field(PINI, "YES") } record(ao, "HL2:SBPM:HL38:XSIM") { field(DESC, "BPM X Pos. Simul.") field(DTYP, "Soft Channel") field(OUT, "HL2:SBPM:HL38:SIM.B PP") field(VAL, "0.5") field(EGU, "mm") field(PINI, "YES") field(PREC, "4") field(LOPR, "-12") field(HOPR, "+12") } record(ao, "HL2:SBPM:HL38:YSIM") { field(DESC, "BPM Y Pos. Simul.") field(DTYP, "Soft Channel") field(OUT, "HL2:SBPM:HL38:SIM.C PP") field(VAL, "0.") field(EGU, "mm") field(PINI, "YES") field(PREC, "4") field(LOPR, "-12") field(HOPR, "+12") } record(ao, "HL2:SBPM:HL38:QSIM") { field(DESC, "BPM Q Simul.") field(DTYP, "Raw Soft Channel") field(OUT, "HL2:SBPM:HL38:SIM.D PP") field(EGU, "Nel") field(ASLO, "6000") #ESLO is used to add attenuation field(LINR, "LINEAR") field(VAL, "1E9") field(PINI, "YES") field(PREC, "4") field(LOPR, "0") field(HOPR, "1E11") } record(ao, "HL2:SBPM:HL38:ROTS") { field(DESC, "BPM Rot. Simul.") field(DTYP, "Soft Channel") field(OUT, "HL2:SBPM:HL38:SIM.E PP") field(VAL, "0.") field(EGU, "deg") field(PINI, "YES") field(PREC, "1") field(LOPR, "-180") } record(ao, "HL2:SBPM:HL38:PSIS") { field(DESC, "BPM Angle. Simul.") field(DTYP, "Soft Channel") field(OUT, "HL2:SBPM:HL38:SIM.F PP") field(VAL, "90") field(EGU, "deg") field(PINI, "YES") field(PREC, "1") field(LOPR, "0") } record(aao, "HL2:SBPM:HL38:DIGISIMW") { field(DESC, "VME Digi Sim. Waveform") field(DTYP, "VmeDigi Sim Wav") field(OUT, "#C2 S0") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32678") field(LOPR, "-32768") # 16384 samples/channel * 4 channels field(NELM, "65536") field(PINI, "NO") } #Used by model/database folks to verify BPM record(ao, "HL2:SBPM:HL38:Z") { field(DESC, "Z Position") field(PINI, "YES") info(autosaveFields, "VAL") } # MPS interface record(bo, "HL2:SBPM:HL38:MPSBYP") { field(DESC, "MPS Bypass") field(DTYP, "BusAddress") field(OUT, "#C0S2@bpmMPS+0,m32") field(MASK, "4") field(ZNAM, "BYPASSED") field(ONAM, "NOT_BYPASSED") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(VAL, "0") field(PINI, "YES") field(ASG, "") info(autosaveFields, "VAL") } record(bo, "HL2:SBPM:HL38:MPSLTBYP") { field(DESC, "MPS Bypass") field(DTYP, "BusAddress") field(OUT, "#C1S2@bpmMPS+0,m32") field(MASK, "4") field(ZNAM, "BYPASSED") field(ONAM, "NOT_BYPASSED") field(ZSV, "NO_ALARM") field(OSV, "NO_ALARM") field(VAL, "0") field(PINI, "YES") field(ASG, "") info(autosaveFields, "VAL") } record(calc, "HL2:SBPM:HL38:MPSIGNRCALC") { field(DESC, "MPS ignore if TMIT too low") field(CALC, "A $[parm]_SEQ # # Different values of the parameter # $[parm0]..$[parm9] are stored in # $[parm]_SEL.A .. $[parm]_SEL.J # # The actual value of the parameter is # selected based on the value of a controlling # PV $[ctrl] using a 'mapping' CALC expression # $[mapc] to convert the $[ctrl] value into # the integer range 1..10. # # The selected value of $[parm] is written # to output link $[outl] # # A) When the user writes $[parm] then # its value is deposited in the currently # selected field of $[parm]_SEL and # propagated to $[outl] # # B) When the user writes any of $[parm]_SEL.A..J # then the value is stored there. If she # writes to the currently 'active' field\ # (as selected by $[ctrl]) then # the $[parm] PV itself is updated and the # value is also propagated to $[outl] # # C) If the user changes $[ctrl] then the # corresponding value $[parm]_SEL.A..J is # propagated to $[outl] and $[parm]. # # D) At initialization, the value corresponding # to the initial setting of $[ctrl] is written # to $[outl] and $[parm] # # MACROS: # # $[parm] PV holding the parameter # $[ctrl] PV that controls the selection of # the currently active setting of # $[parm] # $[outl] PV where the currently selected # value of $[parm] shall be written-to # (if applicable) # $[prec] Precision of the $[parm]_SEL variable # (should be set to same value as $[parm].PREC) # # $[parm0]..$[parm9] initial values of $[parm] # # $[mapc] CALC expression to convert the value # of the controlling PV which is available # as 'A' to the range 1..10 (or less if # less selections are used). # E.g., to convert the value of a bo (0/1) # you would set mapc to 'A+1' (0..1 -> 1..2) # # NOTE: This sb snippet is loaded/expanded # for every parameter under control # of $[ctrl]. ALSO, the companion # snippet parmCtl.db must be loaded/expanded # but only once per controlling PV. # # This record, when scanned (as a result # of $[parm] being written and processing # its FLNK to this record] fetches $[parm] # and deposits the value into the currently # selected field of the SEL record. # # NOTE: unfortunately, the selection # mechanism of the SEQ and SEL # records differs: SEQ is 1-based, # SEL is 0-based -- now that makes # sense, doesn't it? # record(seq, "HL2:SBPM:HL38:UOFF_SEQ") { field(DESC, "Propagate Parm -> SEL") field(DOL1, "HL2:SBPM:HL38:UOFF") field(DOL2, "HL2:SBPM:HL38:UOFF") field(DOL3, "HL2:SBPM:HL38:UOFF") field(DOL4, "HL2:SBPM:HL38:UOFF") field(DOL5, "HL2:SBPM:HL38:UOFF") field(DOL6, "HL2:SBPM:HL38:UOFF") field(DOL7, "HL2:SBPM:HL38:UOFF") field(DOL8, "HL2:SBPM:HL38:UOFF") field(DOL9, "HL2:SBPM:HL38:UOFF") field(DOLA, "HL2:SBPM:HL38:UOFF") field(LNK1, "HL2:SBPM:HL38:UOFF_SEL.A PP") field(LNK2, "HL2:SBPM:HL38:UOFF_SEL.B PP") field(LNK3, "HL2:SBPM:HL38:UOFF_SEL.C PP") field(LNK4, "HL2:SBPM:HL38:UOFF_SEL.D PP") field(LNK5, "HL2:SBPM:HL38:UOFF_SEL.E PP") field(LNK6, "HL2:SBPM:HL38:UOFF_SEL.F PP") field(LNK7, "HL2:SBPM:HL38:UOFF_SEL.G PP") field(LNK8, "HL2:SBPM:HL38:UOFF_SEL.H PP") field(LNK9, "HL2:SBPM:HL38:UOFF_SEL.I PP") field(LNKA, "HL2:SBPM:HL38:UOFF_SEL.J PP") field(SELM, "Specified") field(SELL, "HL2:SBPM:HL38:UOFF_CTRL NPP NMS") } # The $[parm]_SEL record holds all possible # values of $[parm] in the 'A..J' fields. # # When processed it updates it's own VAL # to the currently selected input. Input # 'L' serves as the (1-based) selector, # i.e., L==1 selects 'A'->'VAL'. # # When the selected value changes (as a # result of SEQ depositing a new value OR # $[ctrl] changing and updating L) then # the propagator record attached to the # FLNK is processed. # record(sub, "HL2:SBPM:HL38:UOFF_SEL") { # field(INAM, "parmSelSubInit") field(SNAM, "parmSelSubProc") field(A, "0") field(B, "0") field(C, "") field(D, "") field(E, "") field(F, "") field(G, "") field(H, "") field(I, "") field(J, "") field(PREC, "4") field(FLNK, "HL2:SBPM:HL38:UOFF_PROP") info(autosaveFields, "A B C D E F G H I J") } # # Finally the dfanout record # fetches the currently selected # value from SEL and propagates it # to $[outl]. It also updates # $[parm] itself so that $[parm] # always reflects the currently # selected value. # record(dfanout, "HL2:SBPM:HL38:UOFF_PROP") { field(OMSL, "closed_loop") field(DOL, "HL2:SBPM:HL38:UOFF_SEL") field(OUTA, "HL2:SBPM:HL38:U.AOFF CA") field(OUTB, "HL2:SBPM:HL38:UOFF PP") } # Drive the SEL record when the 'ctrl' PV changes # Use a CA link to monitor such changes record(calcout, "HL2:SBPM:HL38:UOFF_CTRL") { field(INPA, "HL2:SBPM:HL38:PARMSEL CP") field(CALC, "A+1") field(DOPT, "Use CALC") field(OOPT, "On Change") field(OUT, "HL2:SBPM:HL38:UOFF_SEL.L PP") } # Maintain multiple (up to 10) values of # a parameter: # # Record holding the parameter $[parm] # must FLNK -> $[parm]_SEQ # # Different values of the parameter # $[parm0]..$[parm9] are stored in # $[parm]_SEL.A .. $[parm]_SEL.J # # The actual value of the parameter is # selected based on the value of a controlling # PV $[ctrl] using a 'mapping' CALC expression # $[mapc] to convert the $[ctrl] value into # the integer range 1..10. # # The selected value of $[parm] is written # to output link $[outl] # # A) When the user writes $[parm] then # its value is deposited in the currently # selected field of $[parm]_SEL and # propagated to $[outl] # # B) When the user writes any of $[parm]_SEL.A..J # then the value is stored there. If she # writes to the currently 'active' field\ # (as selected by $[ctrl]) then # the $[parm] PV itself is updated and the # value is also propagated to $[outl] # # C) If the user changes $[ctrl] then the # corresponding value $[parm]_SEL.A..J is # propagated to $[outl] and $[parm]. # # D) At initialization, the value corresponding # to the initial setting of $[ctrl] is written # to $[outl] and $[parm] # # MACROS: # # $[parm] PV holding the parameter # $[ctrl] PV that controls the selection of # the currently active setting of # $[parm] # $[outl] PV where the currently selected # value of $[parm] shall be written-to # (if applicable) # $[prec] Precision of the $[parm]_SEL variable # (should be set to same value as $[parm].PREC) # # $[parm0]..$[parm9] initial values of $[parm] # # $[mapc] CALC expression to convert the value # of the controlling PV which is available # as 'A' to the range 1..10 (or less if # less selections are used). # E.g., to convert the value of a bo (0/1) # you would set mapc to 'A+1' (0..1 -> 1..2) # # NOTE: This sb snippet is loaded/expanded # for every parameter under control # of $[ctrl]. ALSO, the companion # snippet parmCtl.db must be loaded/expanded # but only once per controlling PV. # # This record, when scanned (as a result # of $[parm] being written and processing # its FLNK to this record] fetches $[parm] # and deposits the value into the currently # selected field of the SEL record. # # NOTE: unfortunately, the selection # mechanism of the SEQ and SEL # records differs: SEQ is 1-based, # SEL is 0-based -- now that makes # sense, doesn't it? # record(seq, "HL2:SBPM:HL38:VOFF_SEQ") { field(DESC, "Propagate Parm -> SEL") field(DOL1, "HL2:SBPM:HL38:VOFF") field(DOL2, "HL2:SBPM:HL38:VOFF") field(DOL3, "HL2:SBPM:HL38:VOFF") field(DOL4, "HL2:SBPM:HL38:VOFF") field(DOL5, "HL2:SBPM:HL38:VOFF") field(DOL6, "HL2:SBPM:HL38:VOFF") field(DOL7, "HL2:SBPM:HL38:VOFF") field(DOL8, "HL2:SBPM:HL38:VOFF") field(DOL9, "HL2:SBPM:HL38:VOFF") field(DOLA, "HL2:SBPM:HL38:VOFF") field(LNK1, "HL2:SBPM:HL38:VOFF_SEL.A PP") field(LNK2, "HL2:SBPM:HL38:VOFF_SEL.B PP") field(LNK3, "HL2:SBPM:HL38:VOFF_SEL.C PP") field(LNK4, "HL2:SBPM:HL38:VOFF_SEL.D PP") field(LNK5, "HL2:SBPM:HL38:VOFF_SEL.E PP") field(LNK6, "HL2:SBPM:HL38:VOFF_SEL.F PP") field(LNK7, "HL2:SBPM:HL38:VOFF_SEL.G PP") field(LNK8, "HL2:SBPM:HL38:VOFF_SEL.H PP") field(LNK9, "HL2:SBPM:HL38:VOFF_SEL.I PP") field(LNKA, "HL2:SBPM:HL38:VOFF_SEL.J PP") field(SELM, "Specified") field(SELL, "HL2:SBPM:HL38:VOFF_CTRL NPP NMS") } # The $[parm]_SEL record holds all possible # values of $[parm] in the 'A..J' fields. # # When processed it updates it's own VAL # to the currently selected input. Input # 'L' serves as the (1-based) selector, # i.e., L==1 selects 'A'->'VAL'. # # When the selected value changes (as a # result of SEQ depositing a new value OR # $[ctrl] changing and updating L) then # the propagator record attached to the # FLNK is processed. # record(sub, "HL2:SBPM:HL38:VOFF_SEL") { # field(INAM, "parmSelSubInit") field(SNAM, "parmSelSubProc") field(A, "0") field(B, "0") field(C, "") field(D, "") field(E, "") field(F, "") field(G, "") field(H, "") field(I, "") field(J, "") field(PREC, "4") field(FLNK, "HL2:SBPM:HL38:VOFF_PROP") info(autosaveFields, "A B C D E F G H I J") } # # Finally the dfanout record # fetches the currently selected # value from SEL and propagates it # to $[outl]. It also updates # $[parm] itself so that $[parm] # always reflects the currently # selected value. # record(dfanout, "HL2:SBPM:HL38:VOFF_PROP") { field(OMSL, "closed_loop") field(DOL, "HL2:SBPM:HL38:VOFF_SEL") field(OUTA, "HL2:SBPM:HL38:V.AOFF CA") field(OUTB, "HL2:SBPM:HL38:VOFF PP") } # Drive the SEL record when the 'ctrl' PV changes # Use a CA link to monitor such changes record(calcout, "HL2:SBPM:HL38:VOFF_CTRL") { field(INPA, "HL2:SBPM:HL38:PARMSEL CP") field(CALC, "A+1") field(DOPT, "Use CALC") field(OOPT, "On Change") field(OUT, "HL2:SBPM:HL38:VOFF_SEL.L PP") } # Maintain multiple (up to 10) values of # a parameter: # # Record holding the parameter $[parm] # must FLNK -> $[parm]_SEQ # # Different values of the parameter # $[parm0]..$[parm9] are stored in # $[parm]_SEL.A .. $[parm]_SEL.J # # The actual value of the parameter is # selected based on the value of a controlling # PV $[ctrl] using a 'mapping' CALC expression # $[mapc] to convert the $[ctrl] value into # the integer range 1..10. # # The selected value of $[parm] is written # to output link $[outl] # # A) When the user writes $[parm] then # its value is deposited in the currently # selected field of $[parm]_SEL and # propagated to $[outl] # # B) When the user writes any of $[parm]_SEL.A..J # then the value is stored there. If she # writes to the currently 'active' field\ # (as selected by $[ctrl]) then # the $[parm] PV itself is updated and the # value is also propagated to $[outl] # # C) If the user changes $[ctrl] then the # corresponding value $[parm]_SEL.A..J is # propagated to $[outl] and $[parm]. # # D) At initialization, the value corresponding # to the initial setting of $[ctrl] is written # to $[outl] and $[parm] # # MACROS: # # $[parm] PV holding the parameter # $[ctrl] PV that controls the selection of # the currently active setting of # $[parm] # $[outl] PV where the currently selected # value of $[parm] shall be written-to # (if applicable) # $[prec] Precision of the $[parm]_SEL variable # (should be set to same value as $[parm].PREC) # # $[parm0]..$[parm9] initial values of $[parm] # # $[mapc] CALC expression to convert the value # of the controlling PV which is available # as 'A' to the range 1..10 (or less if # less selections are used). # E.g., to convert the value of a bo (0/1) # you would set mapc to 'A+1' (0..1 -> 1..2) # # NOTE: This sb snippet is loaded/expanded # for every parameter under control # of $[ctrl]. ALSO, the companion # snippet parmCtl.db must be loaded/expanded # but only once per controlling PV. # # This record, when scanned (as a result # of $[parm] being written and processing # its FLNK to this record] fetches $[parm] # and deposits the value into the currently # selected field of the SEL record. # # NOTE: unfortunately, the selection # mechanism of the SEQ and SEL # records differs: SEQ is 1-based, # SEL is 0-based -- now that makes # sense, doesn't it? # record(seq, "HL2:SBPM:HL38:USCL_SEQ") { field(DESC, "Propagate Parm -> SEL") field(DOL1, "HL2:SBPM:HL38:USCL") field(DOL2, "HL2:SBPM:HL38:USCL") field(DOL3, "HL2:SBPM:HL38:USCL") field(DOL4, "HL2:SBPM:HL38:USCL") field(DOL5, "HL2:SBPM:HL38:USCL") field(DOL6, "HL2:SBPM:HL38:USCL") field(DOL7, "HL2:SBPM:HL38:USCL") field(DOL8, "HL2:SBPM:HL38:USCL") field(DOL9, "HL2:SBPM:HL38:USCL") field(DOLA, "HL2:SBPM:HL38:USCL") field(LNK1, "HL2:SBPM:HL38:USCL_SEL.A PP") field(LNK2, "HL2:SBPM:HL38:USCL_SEL.B PP") field(LNK3, "HL2:SBPM:HL38:USCL_SEL.C PP") field(LNK4, "HL2:SBPM:HL38:USCL_SEL.D PP") field(LNK5, "HL2:SBPM:HL38:USCL_SEL.E PP") field(LNK6, "HL2:SBPM:HL38:USCL_SEL.F PP") field(LNK7, "HL2:SBPM:HL38:USCL_SEL.G PP") field(LNK8, "HL2:SBPM:HL38:USCL_SEL.H PP") field(LNK9, "HL2:SBPM:HL38:USCL_SEL.I PP") field(LNKA, "HL2:SBPM:HL38:USCL_SEL.J PP") field(SELM, "Specified") field(SELL, "HL2:SBPM:HL38:USCL_CTRL NPP NMS") } # The $[parm]_SEL record holds all possible # values of $[parm] in the 'A..J' fields. # # When processed it updates it's own VAL # to the currently selected input. Input # 'L' serves as the (1-based) selector, # i.e., L==1 selects 'A'->'VAL'. # # When the selected value changes (as a # result of SEQ depositing a new value OR # $[ctrl] changing and updating L) then # the propagator record attached to the # FLNK is processed. # record(sub, "HL2:SBPM:HL38:USCL_SEL") { # field(INAM, "parmSelSubInit") field(SNAM, "parmSelSubProc") field(A, "1") field(B, "1") field(C, "") field(D, "") field(E, "") field(F, "") field(G, "") field(H, "") field(I, "") field(J, "") field(PREC, "4") field(FLNK, "HL2:SBPM:HL38:USCL_PROP") info(autosaveFields, "A B C D E F G H I J") } # # Finally the dfanout record # fetches the currently selected # value from SEL and propagates it # to $[outl]. It also updates # $[parm] itself so that $[parm] # always reflects the currently # selected value. # record(dfanout, "HL2:SBPM:HL38:USCL_PROP") { field(OMSL, "closed_loop") field(DOL, "HL2:SBPM:HL38:USCL_SEL") field(OUTA, "HL2:SBPM:HL38:U.ASLO CA") field(OUTB, "HL2:SBPM:HL38:USCL PP") } # Drive the SEL record when the 'ctrl' PV changes # Use a CA link to monitor such changes record(calcout, "HL2:SBPM:HL38:USCL_CTRL") { field(INPA, "HL2:SBPM:HL38:PARMSEL CP") field(CALC, "A+1") field(DOPT, "Use CALC") field(OOPT, "On Change") field(OUT, "HL2:SBPM:HL38:USCL_SEL.L PP") } # Maintain multiple (up to 10) values of # a parameter: # # Record holding the parameter $[parm] # must FLNK -> $[parm]_SEQ # # Different values of the parameter # $[parm0]..$[parm9] are stored in # $[parm]_SEL.A .. $[parm]_SEL.J # # The actual value of the parameter is # selected based on the value of a controlling # PV $[ctrl] using a 'mapping' CALC expression # $[mapc] to convert the $[ctrl] value into # the integer range 1..10. # # The selected value of $[parm] is written # to output link $[outl] # # A) When the user writes $[parm] then # its value is deposited in the currently # selected field of $[parm]_SEL and # propagated to $[outl] # # B) When the user writes any of $[parm]_SEL.A..J # then the value is stored there. If she # writes to the currently 'active' field\ # (as selected by $[ctrl]) then # the $[parm] PV itself is updated and the # value is also propagated to $[outl] # # C) If the user changes $[ctrl] then the # corresponding value $[parm]_SEL.A..J is # propagated to $[outl] and $[parm]. # # D) At initialization, the value corresponding # to the initial setting of $[ctrl] is written # to $[outl] and $[parm] # # MACROS: # # $[parm] PV holding the parameter # $[ctrl] PV that controls the selection of # the currently active setting of # $[parm] # $[outl] PV where the currently selected # value of $[parm] shall be written-to # (if applicable) # $[prec] Precision of the $[parm]_SEL variable # (should be set to same value as $[parm].PREC) # # $[parm0]..$[parm9] initial values of $[parm] # # $[mapc] CALC expression to convert the value # of the controlling PV which is available # as 'A' to the range 1..10 (or less if # less selections are used). # E.g., to convert the value of a bo (0/1) # you would set mapc to 'A+1' (0..1 -> 1..2) # # NOTE: This sb snippet is loaded/expanded # for every parameter under control # of $[ctrl]. ALSO, the companion # snippet parmCtl.db must be loaded/expanded # but only once per controlling PV. # # This record, when scanned (as a result # of $[parm] being written and processing # its FLNK to this record] fetches $[parm] # and deposits the value into the currently # selected field of the SEL record. # # NOTE: unfortunately, the selection # mechanism of the SEQ and SEL # records differs: SEQ is 1-based, # SEL is 0-based -- now that makes # sense, doesn't it? # record(seq, "HL2:SBPM:HL38:VSCL_SEQ") { field(DESC, "Propagate Parm -> SEL") field(DOL1, "HL2:SBPM:HL38:VSCL") field(DOL2, "HL2:SBPM:HL38:VSCL") field(DOL3, "HL2:SBPM:HL38:VSCL") field(DOL4, "HL2:SBPM:HL38:VSCL") field(DOL5, "HL2:SBPM:HL38:VSCL") field(DOL6, "HL2:SBPM:HL38:VSCL") field(DOL7, "HL2:SBPM:HL38:VSCL") field(DOL8, "HL2:SBPM:HL38:VSCL") field(DOL9, "HL2:SBPM:HL38:VSCL") field(DOLA, "HL2:SBPM:HL38:VSCL") field(LNK1, "HL2:SBPM:HL38:VSCL_SEL.A PP") field(LNK2, "HL2:SBPM:HL38:VSCL_SEL.B PP") field(LNK3, "HL2:SBPM:HL38:VSCL_SEL.C PP") field(LNK4, "HL2:SBPM:HL38:VSCL_SEL.D PP") field(LNK5, "HL2:SBPM:HL38:VSCL_SEL.E PP") field(LNK6, "HL2:SBPM:HL38:VSCL_SEL.F PP") field(LNK7, "HL2:SBPM:HL38:VSCL_SEL.G PP") field(LNK8, "HL2:SBPM:HL38:VSCL_SEL.H PP") field(LNK9, "HL2:SBPM:HL38:VSCL_SEL.I PP") field(LNKA, "HL2:SBPM:HL38:VSCL_SEL.J PP") field(SELM, "Specified") field(SELL, "HL2:SBPM:HL38:VSCL_CTRL NPP NMS") } # The $[parm]_SEL record holds all possible # values of $[parm] in the 'A..J' fields. # # When processed it updates it's own VAL # to the currently selected input. Input # 'L' serves as the (1-based) selector, # i.e., L==1 selects 'A'->'VAL'. # # When the selected value changes (as a # result of SEQ depositing a new value OR # $[ctrl] changing and updating L) then # the propagator record attached to the # FLNK is processed. # record(sub, "HL2:SBPM:HL38:VSCL_SEL") { # field(INAM, "parmSelSubInit") field(SNAM, "parmSelSubProc") field(A, "1") field(B, "1") field(C, "") field(D, "") field(E, "") field(F, "") field(G, "") field(H, "") field(I, "") field(J, "") field(PREC, "4") field(FLNK, "HL2:SBPM:HL38:VSCL_PROP") info(autosaveFields, "A B C D E F G H I J") } # # Finally the dfanout record # fetches the currently selected # value from SEL and propagates it # to $[outl]. It also updates # $[parm] itself so that $[parm] # always reflects the currently # selected value. # record(dfanout, "HL2:SBPM:HL38:VSCL_PROP") { field(OMSL, "closed_loop") field(DOL, "HL2:SBPM:HL38:VSCL_SEL") field(OUTA, "HL2:SBPM:HL38:V.ASLO CA") field(OUTB, "HL2:SBPM:HL38:VSCL PP") } # Drive the SEL record when the 'ctrl' PV changes # Use a CA link to monitor such changes record(calcout, "HL2:SBPM:HL38:VSCL_CTRL") { field(INPA, "HL2:SBPM:HL38:PARMSEL CP") field(CALC, "A+1") field(DOPT, "Use CALC") field(OOPT, "On Change") field(OUT, "HL2:SBPM:HL38:VSCL_SEL.L PP") } # Maintain multiple (up to 10) values of # a parameter: # # Record holding the parameter $[parm] # must FLNK -> $[parm]_SEQ # # Different values of the parameter # $[parm0]..$[parm9] are stored in # $[parm]_SEL.A .. $[parm]_SEL.J # # The actual value of the parameter is # selected based on the value of a controlling # PV $[ctrl] using a 'mapping' CALC expression # $[mapc] to convert the $[ctrl] value into # the integer range 1..10. # # The selected value of $[parm] is written # to output link $[outl] # # A) When the user writes $[parm] then # its value is deposited in the currently # selected field of $[parm]_SEL and # propagated to $[outl] # # B) When the user writes any of $[parm]_SEL.A..J # then the value is stored there. If she # writes to the currently 'active' field\ # (as selected by $[ctrl]) then # the $[parm] PV itself is updated and the # value is also propagated to $[outl] # # C) If the user changes $[ctrl] then the # corresponding value $[parm]_SEL.A..J is # propagated to $[outl] and $[parm]. # # D) At initialization, the value corresponding # to the initial setting of $[ctrl] is written # to $[outl] and $[parm] # # MACROS: # # $[parm] PV holding the parameter # $[ctrl] PV that controls the selection of # the currently active setting of # $[parm] # $[outl] PV where the currently selected # value of $[parm] shall be written-to # (if applicable) # $[prec] Precision of the $[parm]_SEL variable # (should be set to same value as $[parm].PREC) # # $[parm0]..$[parm9] initial values of $[parm] # # $[mapc] CALC expression to convert the value # of the controlling PV which is available # as 'A' to the range 1..10 (or less if # less selections are used). # E.g., to convert the value of a bo (0/1) # you would set mapc to 'A+1' (0..1 -> 1..2) # # NOTE: This sb snippet is loaded/expanded # for every parameter under control # of $[ctrl]. ALSO, the companion # snippet parmCtl.db must be loaded/expanded # but only once per controlling PV. # # This record, when scanned (as a result # of $[parm] being written and processing # its FLNK to this record] fetches $[parm] # and deposits the value into the currently # selected field of the SEL record. # # NOTE: unfortunately, the selection # mechanism of the SEQ and SEL # records differs: SEQ is 1-based, # SEL is 0-based -- now that makes # sense, doesn't it? # record(seq, "HL2:SBPM:HL38:PHI_SEQ") { field(DESC, "Propagate Parm -> SEL") field(DOL1, "HL2:SBPM:HL38:PHI") field(DOL2, "HL2:SBPM:HL38:PHI") field(DOL3, "HL2:SBPM:HL38:PHI") field(DOL4, "HL2:SBPM:HL38:PHI") field(DOL5, "HL2:SBPM:HL38:PHI") field(DOL6, "HL2:SBPM:HL38:PHI") field(DOL7, "HL2:SBPM:HL38:PHI") field(DOL8, "HL2:SBPM:HL38:PHI") field(DOL9, "HL2:SBPM:HL38:PHI") field(DOLA, "HL2:SBPM:HL38:PHI") field(LNK1, "HL2:SBPM:HL38:PHI_SEL.A PP") field(LNK2, "HL2:SBPM:HL38:PHI_SEL.B PP") field(LNK3, "HL2:SBPM:HL38:PHI_SEL.C PP") field(LNK4, "HL2:SBPM:HL38:PHI_SEL.D PP") field(LNK5, "HL2:SBPM:HL38:PHI_SEL.E PP") field(LNK6, "HL2:SBPM:HL38:PHI_SEL.F PP") field(LNK7, "HL2:SBPM:HL38:PHI_SEL.G PP") field(LNK8, "HL2:SBPM:HL38:PHI_SEL.H PP") field(LNK9, "HL2:SBPM:HL38:PHI_SEL.I PP") field(LNKA, "HL2:SBPM:HL38:PHI_SEL.J PP") field(SELM, "Specified") field(SELL, "HL2:SBPM:HL38:PHI_CTRL NPP NMS") } # The $[parm]_SEL record holds all possible # values of $[parm] in the 'A..J' fields. # # When processed it updates it's own VAL # to the currently selected input. Input # 'L' serves as the (1-based) selector, # i.e., L==1 selects 'A'->'VAL'. # # When the selected value changes (as a # result of SEQ depositing a new value OR # $[ctrl] changing and updating L) then # the propagator record attached to the # FLNK is processed. # record(sub, "HL2:SBPM:HL38:PHI_SEL") { # field(INAM, "parmSelSubInit") field(SNAM, "parmSelSubProc") field(A, "0") field(B, "0") field(C, "") field(D, "") field(E, "") field(F, "") field(G, "") field(H, "") field(I, "") field(J, "") field(PREC, "1") field(FLNK, "HL2:SBPM:HL38:PHI_PROP") info(autosaveFields, "A B C D E F G H I J") } # # Finally the dfanout record # fetches the currently selected # value from SEL and propagates it # to $[outl]. It also updates # $[parm] itself so that $[parm] # always reflects the currently # selected value. # record(dfanout, "HL2:SBPM:HL38:PHI_PROP") { field(OMSL, "closed_loop") field(DOL, "HL2:SBPM:HL38:PHI_SEL") field(OUTA, "HL2:SBPM:HL38:CALC.E CA") field(OUTB, "HL2:SBPM:HL38:PHI PP") } # Drive the SEL record when the 'ctrl' PV changes # Use a CA link to monitor such changes record(calcout, "HL2:SBPM:HL38:PHI_CTRL") { field(INPA, "HL2:SBPM:HL38:PARMSEL CP") field(CALC, "A+1") field(DOPT, "Use CALC") field(OOPT, "On Change") field(OUT, "HL2:SBPM:HL38:PHI_SEL.L PP") } # Maintain multiple (up to 10) values of # a parameter: # # Record holding the parameter $[parm] # must FLNK -> $[parm]_SEQ # # Different values of the parameter # $[parm0]..$[parm9] are stored in # $[parm]_SEL.A .. $[parm]_SEL.J # # The actual value of the parameter is # selected based on the value of a controlling # PV $[ctrl] using a 'mapping' CALC expression # $[mapc] to convert the $[ctrl] value into # the integer range 1..10. # # The selected value of $[parm] is written # to output link $[outl] # # A) When the user writes $[parm] then # its value is deposited in the currently # selected field of $[parm]_SEL and # propagated to $[outl] # # B) When the user writes any of $[parm]_SEL.A..J # then the value is stored there. If she # writes to the currently 'active' field\ # (as selected by $[ctrl]) then # the $[parm] PV itself is updated and the # value is also propagated to $[outl] # # C) If the user changes $[ctrl] then the # corresponding value $[parm]_SEL.A..J is # propagated to $[outl] and $[parm]. # # D) At initialization, the value corresponding # to the initial setting of $[ctrl] is written # to $[outl] and $[parm] # # MACROS: # # $[parm] PV holding the parameter # $[ctrl] PV that controls the selection of # the currently active setting of # $[parm] # $[outl] PV where the currently selected # value of $[parm] shall be written-to # (if applicable) # $[prec] Precision of the $[parm]_SEL variable # (should be set to same value as $[parm].PREC) # # $[parm0]..$[parm9] initial values of $[parm] # # $[mapc] CALC expression to convert the value # of the controlling PV which is available # as 'A' to the range 1..10 (or less if # less selections are used). # E.g., to convert the value of a bo (0/1) # you would set mapc to 'A+1' (0..1 -> 1..2) # # NOTE: This sb snippet is loaded/expanded # for every parameter under control # of $[ctrl]. ALSO, the companion # snippet parmCtl.db must be loaded/expanded # but only once per controlling PV. # # This record, when scanned (as a result # of $[parm] being written and processing # its FLNK to this record] fetches $[parm] # and deposits the value into the currently # selected field of the SEL record. # # NOTE: unfortunately, the selection # mechanism of the SEQ and SEL # records differs: SEQ is 1-based, # SEL is 0-based -- now that makes # sense, doesn't it? # record(seq, "HL2:SBPM:HL38:PSI_SEQ") { field(DESC, "Propagate Parm -> SEL") field(DOL1, "HL2:SBPM:HL38:PSI") field(DOL2, "HL2:SBPM:HL38:PSI") field(DOL3, "HL2:SBPM:HL38:PSI") field(DOL4, "HL2:SBPM:HL38:PSI") field(DOL5, "HL2:SBPM:HL38:PSI") field(DOL6, "HL2:SBPM:HL38:PSI") field(DOL7, "HL2:SBPM:HL38:PSI") field(DOL8, "HL2:SBPM:HL38:PSI") field(DOL9, "HL2:SBPM:HL38:PSI") field(DOLA, "HL2:SBPM:HL38:PSI") field(LNK1, "HL2:SBPM:HL38:PSI_SEL.A PP") field(LNK2, "HL2:SBPM:HL38:PSI_SEL.B PP") field(LNK3, "HL2:SBPM:HL38:PSI_SEL.C PP") field(LNK4, "HL2:SBPM:HL38:PSI_SEL.D PP") field(LNK5, "HL2:SBPM:HL38:PSI_SEL.E PP") field(LNK6, "HL2:SBPM:HL38:PSI_SEL.F PP") field(LNK7, "HL2:SBPM:HL38:PSI_SEL.G PP") field(LNK8, "HL2:SBPM:HL38:PSI_SEL.H PP") field(LNK9, "HL2:SBPM:HL38:PSI_SEL.I PP") field(LNKA, "HL2:SBPM:HL38:PSI_SEL.J PP") field(SELM, "Specified") field(SELL, "HL2:SBPM:HL38:PSI_CTRL NPP NMS") } # The $[parm]_SEL record holds all possible # values of $[parm] in the 'A..J' fields. # # When processed it updates it's own VAL # to the currently selected input. Input # 'L' serves as the (1-based) selector, # i.e., L==1 selects 'A'->'VAL'. # # When the selected value changes (as a # result of SEQ depositing a new value OR # $[ctrl] changing and updating L) then # the propagator record attached to the # FLNK is processed. # record(sub, "HL2:SBPM:HL38:PSI_SEL") { # field(INAM, "parmSelSubInit") field(SNAM, "parmSelSubProc") field(A, "90") field(B, "90") field(C, "") field(D, "") field(E, "") field(F, "") field(G, "") field(H, "") field(I, "") field(J, "") field(PREC, "1") field(FLNK, "HL2:SBPM:HL38:PSI_PROP") info(autosaveFields, "A B C D E F G H I J") } # # Finally the dfanout record # fetches the currently selected # value from SEL and propagates it # to $[outl]. It also updates # $[parm] itself so that $[parm] # always reflects the currently # selected value. # record(dfanout, "HL2:SBPM:HL38:PSI_PROP") { field(OMSL, "closed_loop") field(DOL, "HL2:SBPM:HL38:PSI_SEL") field(OUTA, "HL2:SBPM:HL38:CALC.F CA") field(OUTB, "HL2:SBPM:HL38:PSI PP") } # Drive the SEL record when the 'ctrl' PV changes # Use a CA link to monitor such changes record(calcout, "HL2:SBPM:HL38:PSI_CTRL") { field(INPA, "HL2:SBPM:HL38:PARMSEL CP") field(CALC, "A+1") field(DOPT, "Use CALC") field(OOPT, "On Change") field(OUT, "HL2:SBPM:HL38:PSI_SEL.L PP") } record(longout, "HL2:SBPM:HL38:PARMSEL") { field(VAL, "0") field(PINI, "YES") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBDEND # per BPM database for stripline BPMs ############################################## # This is the head of the main processing chain # that runs at the highest priority. ############################################## ############################################# # This is the head of the processing chain for # diagnostics. ############################################## record(ai, "HL3A:SBPM:HL39:GRN") { field(DESC, "GRN Strip Amplitude") field(DTYP, "Raw Bpm Signal") # 'card' selects PAD number, 'signal' selects strip field(INP, "#C3 S0") field(EGU, "raw") #TODO set HOPR/LOPR, alarm limits field(SCAN, "I/O Intr") # The priority determines what scan list we are being # put on (see drvPadUdpComm.c) field(PRIO, "LOW") field(FLNK, "HL3A:SBPM:HL39:RED") # HOPR for the energy algorithm is determined as follows: # # inf inf # 1) Fourier relation / h^2 dt = / |H|^2 df = 2 B # 0 -inf # # 1a) It can be shown that the maximum of the impuls response # ha is ~ 2 B # # 2) The digitizer produces the numbers # # Ai = 2^s (hi/ha) # # where ha is the maximum of the impuls response # and 2^s is a scale factor. # # 3) 'Energy algorithm' calculates S = sum( Ai^2 ) # # inf # 4) S = (2^s / ha)^2 sum(hi^2) = K sum(hi^2) Dt ~ K / h^2 dt # 0 # # with K = (2^s / ha)^2 fs # # 5) From 4) and 1a) -> S ~ K ha and therefore # # 6) S = 2^(2s) fs/ha = 2^(2s) fs/(2 B) # # 7) The strip signals are sqrt(S); hence HOPR is about # # HOPR ~ 2^s sqrt( fs/2/B ) # # with 2^s = 32768, fs=120MHz, B=10MHz it follows # that HOPR ~ 1E5; we add some margin... field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(ai, "HL3A:SBPM:HL39:RED") { field(DESC, "RED Strip Amplitude") field(DTYP, "Raw Bpm Signal") # 'card' selects PAD number, 'signal' selects strip field(INP, "#C3 S1") field(EGU, "raw") field(SCAN, "Passive") field(FLNK, "HL3A:SBPM:HL39:BLU") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(ai, "HL3A:SBPM:HL39:BLU") { field(DESC, "BLU Strip Amplitude") field(DTYP, "Raw Bpm Signal") # 'card' selects PAD number, 'signal' selects strip field(INP, "#C3 S2") field(EGU, "raw") field(SCAN, "Passive") field(FLNK, "HL3A:SBPM:HL39:YLO") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(ai, "HL3A:SBPM:HL39:YLO") { field(DESC, "YLO Strip Amplitude") field(DTYP, "Raw Bpm Signal") # 'card' selects PAD number, 'signal' selects strip field(INP, "#C3 S3") field(EGU, "raw") field(SCAN, "Passive") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } ############################################## # Slowly-scanned diagnostics ############################################## # record(waveform, "HL3A:SBPM:HL39:REDW") { field(DESC, "Raw CAL RED Data") field(DTYP, "WavBuf") # 'signal' number selects 'beam', 'calX', 'calY' field(INP, "#C3 S1") field(NELM, "512") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32768") field(LOPR, "-32767") field(SCAN, "1 second") } record(waveform, "HL3A:SBPM:HL39:GRNW") { field(DESC, "Raw CAL GRN Data") field(DTYP, "WavBuf") # 'signal' number selects 'beam', 'calX', 'calY' field(INP, "#C3 S2") field(NELM, "512") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32768") field(LOPR, "-32767") field(SCAN, "1 second") } record(waveform, "HL3A:SBPM:HL39:RAWDBG") { field(DESC, "Raw BEAM Dbg") field(DTYP, "WavBuf") # 'signal' number selects 'beam', 'calX', 'calY' # do not 'wbscan' for now since e.g., an underrange # condition on the real signal can happen. field(INP, "#C3 S7") field(NELM, "512") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32768") field(LOPR, "-32767") field(SCAN, "Passive") } record(waveform, "HL3A:SBPM:HL39:REDDBG") { field(DESC, "Raw CAL RED Dbg") field(DTYP, "WavBuf") # 'signal' number selects 'beam', 'calX', 'calY' field(INP, "#C3 S8 @wbscan") field(NELM, "512") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32768") field(LOPR, "-32767") field(SCAN, "Passive") } record(waveform, "HL3A:SBPM:HL39:GRNDBG") { field(DESC, "Raw CAL GRN Dbg") field(DTYP, "WavBuf") # 'signal' number selects 'beam', 'calX', 'calY' field(INP, "#C3 S9 @wbscan") field(NELM, "512") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32768") field(LOPR, "-32767") field(SCAN, "Passive") } record(ai, "HL3A:SBPM:HL39:GRUV") { field(DESC, "CAL Gain GRN/RED") field(DTYP, "Raw Stripl Calp") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C3 S0") field(SCAN, "10 second") field(PREC, "4") field(LOPR, "0.5") field(HOPR, "1.5") } record(ai, "HL3A:SBPM:HL39:GRU") { field(DESC, "CAL Gain GRN/BLU") field(DTYP, "Raw Stripl Calp") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C3 S1") field(SCAN, "10 second") field(PREC, "4") field(LOPR, "0.5") field(HOPR, "1.5") info(autosaveFields, "ASLO") } record(ai, "HL3A:SBPM:HL39:GRV") { field(DESC, "CAL Gain RED/YLO") field(DTYP, "Raw Stripl Calp") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C3 S2") field(SCAN, "10 second") field(PREC, "4") field(LOPR, "0.5") field(HOPR, "1.5") info(autosaveFields, "ASLO") } record(ai, "HL3A:SBPM:HL39:TGRN") { field(DESC, "Green arrival time") field(DTYP, "Raw Bpm Signal") field(EGU, "ADC Clocks") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C3 S4") field(SCAN, "10 second") field(PREC, "1") field(LOPR, "0") field(HOPR, "128") field(LOLO, "5") field(LOW, "8") field(HIGH, "60") field(HIHI, "70") field(LLSV, "MAJOR") field(LSV, "MINOR") field(HSV, "MINOR") field(HHSV, "MAJOR") } record(ai, "HL3A:SBPM:HL39:TRED") { field(DESC, "Red arrival time") field(DTYP, "Raw Bpm Signal") field(EGU, "ADC Clocks") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C3 S5") field(SCAN, "10 second") field(PREC, "1") field(LOPR, "0") field(HOPR, "128") field(LOLO, "5") field(LOW, "8") field(HIGH, "60") field(HIHI, "70") field(LLSV, "MAJOR") field(LSV, "MINOR") field(HSV, "MINOR") field(HHSV, "MAJOR") } record(ai, "HL3A:SBPM:HL39:TBLU") { field(DESC, "Blue arrival time") field(DTYP, "Raw Bpm Signal") field(EGU, "ADC Clocks") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C3 S6") field(SCAN, "10 second") field(PREC, "1") field(LOPR, "0") field(HOPR, "128") field(LOLO, "5") field(LOW, "8") field(HIGH, "60") field(HIHI, "70") field(LLSV, "MAJOR") field(LSV, "MINOR") field(HSV, "MINOR") field(HHSV, "MAJOR") } record(ai, "HL3A:SBPM:HL39:TYLO") { field(DESC, "Yellow arrival time") field(DTYP, "Raw Bpm Signal") field(EGU, "ADC Clocks") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C3 S7") field(SCAN, "10 second") field(PREC, "1") field(LOPR, "0") field(HOPR, "128") field(LOLO, "5") field(LOW, "8") field(HIGH, "60") field(HIHI, "70") field(LLSV, "MAJOR") field(LSV, "MINOR") field(HSV, "MINOR") field(HHSV, "MAJOR") } record(ao, "HL3A:SBPM:HL39:PINC_ADJ") { field(DESC, "Adjust Pinc. Corr.") field(DTYP, "Soft Channel") field(OUT, "HL3A:SBPM:HL39:CALC.K PP MS") field(VAL, "0") field(DRVL, "0") field(DRVH, "2") field(PINI, "YES") info(autosaveFields, "VAL") } # QSCL setting: # # Q: charge # Z: impedance # F: form factor: phi/(2 pi) sin(2 pi f l/c) # # Signal = Q Z F G h(t) = A h(t) [A] = Vs # # inf inf # Energy = A^2 / h^2(t) dt = A^2 / |H(w)|^2 dw/2/pi = A^2 B # 0 0 # # Measured energy = Sum{ (Vp/32768 * xi)^2 } / fs = S / fs ~ Energy # # -> A^2 B = S/fs # # With T = sqrt( Sum{ xi^2 } ) # # A = sqrt(S)/sqrt(B*fs) = T/sqrt(B*fs) Vp/32768 # # T/32768 Vp # Q = A/F/G/Z = ----------------- # F G Z sqrt(B*fs) # # Vp = { 1.5Vpp/2 (PGA=1) or 2.25Vpp/2 (PGA=0) } / 2 (transformer) # # I believe PGA is off (-> Vp ~ .56V) # # Z = 50 # # G: (calibration uses GRN/BLU -> signal should have the # level of the grn/red channels with the additional switch) # # Block diagram / parts / gain: # # [filt] [Att1] [Amp1] [Att2] [BPF] [Amp2] [pad] [Amp3] [switch] # f-17520 hmc540lp3 SBF-5089 hmc540lp3 MBP-140-6-4 SBF-4089 PAT-0 SBF-4089 HMC-197 # # -2dB* -1dB 20dB -1dB -4.5 14.8dB 0dB 14.8dB -0.4dB # # *: 1st filter ATT is a wild guess. # BPF loss (RLC Catalog, pp.55): (L (nsect+.5) / (% of 3dB BW) + .2) dB # with L ~6.2 10MHz/fc=140Mhz filter-> 4.5 # # -> Gtot ~ 40.7dB # # subtract cable loss (2dB); Gtot = 86 # # T/32768 Vp .56V/32768 # Q = A/F/G/Z = ----------------- = T/F ------------------------ # F G Z sqrt(B*fs) 86*50*sqrt(10*140)Mhz # # = T/F = 1.06E-7/F nC # # F for a 7% coverage, 4" BPM at 140MHz .07 sin(2*pi*140e6 4*.0254/3e8) # = .021 # # => 1.06E-7/.021 nC = 5E-6 nC # # (Faraday cup measurement -> (3600/44)^-1 1e-4 -> 1.22E-6 # record(ao, "HL3A:SBPM:HL39:QSCL") { field(DESC, "TMIT/Charge Scale") field(DTYP, "Soft Channel") field(OUT, "HL3A:SBPM:HL39:QSCA.A PP MS") # 5.0E-6 / 1.6E-10 [nC/e-] field(VAL, "31250") field(EGU, "Nel") field(PREC, "3") field(PINI, "YES") info(autosaveFields, "VAL") } # Adjust TMIT scale for AFE attenuation record(calcout, "HL3A:SBPM:HL39:QSCA") { field(DESC, "TMIT ATT Adj. Scale") field(INPB, "HL3A:SBPM:HL39:ATT1 CP") field(INPC, "HL3A:SBPM:HL39:ATT2 CP") field(CALC, "A*10^((B+C+D)/20)") # use CA link to deposit into TMIT.ASLO so # that TMIT is not forced into linkset # of this record field(OUT, "HL3A:SBPM:HL39:TMIT.ASLO CA") field(EGU, "Nel") field(PREC, "3") info(autosaveFields, "D") } record(ao, "HL3A:SBPM:HL39:ATT1SIMP") { field(DESC, "ATT1 Propagator") field(DTYP, "Soft Channel") field(DOL, "HL3A:SBPM:HL39:ATT1 CP") field(OMSL, "closed_loop") field(OUT, "HL3A:SBPM:HL39:ASIM.A PP") field(IVOA, "Set output to IVOV") field(IVOV, "0") field(EGU, "dB") } record(ao, "HL3A:SBPM:HL39:ATT2SIMP") { field(DESC, "ATT2 Propagator") field(DTYP, "Soft Channel") field(DOL, "HL3A:SBPM:HL39:ATT2 CP") field(OMSL, "closed_loop") field(OUT, "HL3A:SBPM:HL39:ASIM.C PP") field(IVOA, "Set output to IVOV") field(IVOV, "0") field(EGU, "dB") } # Attenuate charge either by # real attenuator settings or # by fake ones. # If B, C >= 0 then their # values will be used instead # of ATT1, ATT2 record(calcout, "HL3A:SBPM:HL39:ASIM") { field(DESC, "Q Simul Attenuator") field(DTYP, "Soft Channel") field(OUT, "HL3A:SBPM:HL39:QSIM.ESLO PP") # ATT1SIM puts value into A # set to -1 to use real attenuator settings # and >=0 to use B instead field(B, "-1") # ATT2SIM puts value into C # set to -1 to use real attenuator settings # and >=0 to use D instead field(D, "-1") field(CALC, "10^(((B>=0?B:A)+(D>=0?D:C))/20)") field(PINI, "YES") } record(ao, "HL3A:SBPM:HL39:WSIM") { field(DESC, "BPM W Simul.") field(DTYP, "Soft Channel") field(OUT, "HL3A:SBPM:HL39:SIM.G PP") field(VAL, "0.07") field(EGU, "%") field(PINI, "YES") field(PREC, "3") field(LOPR, "0") field(HOPR, "0.25") } record(sel, "HL3A:SBPM:HL39:STA") { field(DESC, "Status Summary") field(SELM, "High Signal") field(INPA, "HL3A:SBPM:HL39:RSTA.SEVR MS NPP") field(INPB, "HL3A:SBPM:HL39:TMIT.SEVR MS NPP") field(INPC, "HL3A:SBPM:HL39:Y.SEVR MS NPP") field(INPD, "HL3A:SBPM:HL39:X.SEVR MS NPP") field(INPE, "HL3A:SBPM:HL39:TGRN.SEVR MS NPP") field(INPF, "HL3A:SBPM:HL39:TRED.SEVR MS NPP") field(INPG, "HL3A:SBPM:HL39:TBLU.SEVR MS NPP") field(INPH, "HL3A:SBPM:HL39:TYLO.SEVR MS NPP") field(INPI, "HL3A:SBPM:HL39:GRU.SEVR MS NPP") field(INPJ, "HL3A:SBPM:HL39:GRV.SEVR MS NPP") field(SCAN, "1 second") } # This record really belongs on the # PAD IOC. We keep them here however # so we can save/restore. It is more # confusing but shouldn't matter from # an efficiency standpoint (they are # rarely changed). record(longout, "HL3A:SBPM:HL39:ATTO") { field(DESC, "AFE Tot. Att. Offset") # fetched via inlink #field(OUT, "HL3A:SBPM:HL39:ATTC.B PP") field(DRVL, "-10") field(DRVH, "30") field(LOPR, "-10") field(HOPR, "30") field(EGU, "dB") field(VAL, "0") field(PINI, "YES") info(autosaveFields, "VAL DRVH HOPR DRVL LOPR") } # This record really belongs on the # PAD IOC. We keep them here however # so we can save/restore. It is more # confusing but shouldn't matter from # an efficiency standpoint (they are # rarely changed). record(longout, "HL3A:SBPM:HL39:CLAO") { field(DESC, "AFE Cal. Att. Offset") # fetched via inlink #field(OUT, "HL3A:SBPM:HL39:ATTC.C PP") field(DRVL, "-20") field(DRVH, "20") field(LOPR, "-20") field(HOPR, "20") field(EGU, "dB") field(VAL, "40") field(PINI, "YES") info(autosaveFields, "VAL DRVH HOPR DRVL LOPR") } record(calc, "HL3A:SBPM:HL39:STA_ALH") { field(DESC, "Status Summary") field(SCAN, "1 second") field(CALC, "0") field(INPA, "HL3A:SBPM:HL39:RSTA_ALH.SEVR MS NPP") field(INPB, "HL3A:SBPM:HL39:GRU.SEVR MS NPP") field(INPC, "HL3A:SBPM:HL39:GRV.SEVR MS NPP") field(INPD, "HL3A:SBPM:HL39:CHK.SEVR MS NPP") field(INPE, "") field(INPF, "HL3A:SBPM:HL39:AFE_COMM.SEVR MS NPP") } # snapshot PV for the bpm values display record(ai, "HL3A:SBPM:HL39:GRN_SLOW") { field(DESC, "GRN snapshot for display") field(INP, "HL3A:SBPM:HL39:GRN NPP MS") field(EGU, "raw") field(SCAN, "1 second") field(FLNK, "HL3A:SBPM:HL39:RED_SLOW") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(ai, "HL3A:SBPM:HL39:RED_SLOW") { field(DESC, "RED snapshot for display") # 'card' selects PAD number, 'signal' selects strip field(INP, "HL3A:SBPM:HL39:RED NPP MS") field(EGU, "raw") field(SCAN, "Passive") field(FLNK, "HL3A:SBPM:HL39:BLU_SLOW") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(ai, "HL3A:SBPM:HL39:BLU_SLOW") { field(DESC, "BLU snapshot for display") # 'card' selects PAD number, 'signal' selects strip field(INP, "HL3A:SBPM:HL39:BLU NPP MS") field(EGU, "raw") field(SCAN, "Passive") field(FLNK, "HL3A:SBPM:HL39:YLO_SLOW") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(ai, "HL3A:SBPM:HL39:YLO_SLOW") { field(DESC, "YLO snapshot for display") field(INP, "HL3A:SBPM:HL39:YLO NPP MS") field(EGU, "raw") field(SCAN, "Passive") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(sub, "HL3A:SBPM:HL39:CALC") { field(SNAM, "drvBpmBvectSetupSub") # E: phi F: psi # BPM channel number in L field(INPL, "3") field(SCAN, "Passive") } record(bo, "HL3A:SBPM:HL39:PINC_ENA") { field(DESC, "Simple Pincushion Alg") field(DTYP, "BusAddress") field(OUT, "#C0S2@drvBpmStriplPincEna,m32") field(MASK, "8") field(ZNAM, "DISABLED") field(ONAM, "ENABLED") field(VAL, "0") field(PINI, "YES") info(autosaveFields, "VAL") } record(ao, "HL3A:SBPM:HL39:UDR_THRES") { field(DESC, "Detection Underrange Threshold") field(DTYP, "Bpm Parameters") field(OUT, "#C3S0") field(EGU, "ADC Ticks") field(DOL, "45.26") field(PINI, "YES") field(DRVL, "0") field(DRVH, "32767") info(autosaveFields, "VAL") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBDEND # per BPM database for stripline BPMs ###################################### # HEAD of main processing chain ###################################### record(ai, "HL3A:SBPM:HL39:X") { field(DESC, "X Position") field(EGU, "mm") field(DTYP, "Raw Bpm Signal") field(INP, "#C3 S11") field(SCAN, "I/O Intr") # The priority determines what scan list we are being # put on (see drvPadUdpComm.c) field(PRIO, "HIGH") field(FLNK, "HL3A:SBPM:HL39:Y") field(PREC, "4") field(LOPR, "-12") field(HOPR, "+12") field(ASG, "") field(TSE, "-2") info(autosaveFields, "ASLO LOLO LOW HIGH HIHI HHSV LLSV") } record(ai, "HL3A:SBPM:HL39:Y") { field(DESC, "Y Position") field(EGU, "mm") field(DTYP, "Raw Bpm Signal") field(INP, "#C3 S12") field(FLNK, "HL3A:SBPM:HL39:TMIT") field(PREC, "4") field(LOPR, "-12") field(HOPR, "+12") field(ASG, "") field(TSE, "-2") info(autosaveFields, "ASLO LOLO LOW HIGH HIHI HHSV LLSV") } record(ai, "HL3A:SBPM:HL39:TMIT") { field(DESC, "Charge Estimate") field(DTYP, "Raw Bpm Signal") field(INP, "#C3 S13") field(EGU, "Nel") field(PREC, "3") field(LOPR, "0") field(HOPR, "1E11") # FLINK into BSA field(FLNK, "HL3A:SBPM:HL39:EFX.PROC") field(ASG, "") field(TSE, "-2") info(autosaveFields, "LOLO LOW HIGH HIHI HHSV LLSV ") } ###################################### # HEAD of diagnostics processing chain ###################################### # leave RWAV in it's own lockset; don't FLNK # to 'U' & friends record(waveform, "HL3A:SBPM:HL39:RWAV") { field(DESC, "Raw BPM Data") field(DTYP, "WavBuf") # 'signal' number selects 'beam', 'calX', 'calY' field(INP, "#C3 S0") field(SCAN, "I/O Intr") # use LOW or HIGH to end up on the 'diagnostic' # scan list (see drvPadUdpComm.c) field(PRIO, "LOW") field(NELM, "512") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32768") field(LOPR, "-32767") } record(ai, "HL3A:SBPM:HL39:U") { field(DESC, "Raw U Position") field(DTYP, "Raw Bpm Signal") field(INP, "#C3 S8") field(SCAN, "I/O Intr") # use LOW or HIGH to end up on the 'diagnostic' # scan list (see drvPadUdpComm.c) field(PRIO, "LOW") field(PREC, "5") field(EGU, "mm") field(LOPR, "-0.7") field(HOPR, "+0.7") field(FLNK, "HL3A:SBPM:HL39:V") } record(ai, "HL3A:SBPM:HL39:V") { field(DESC, "Raw V Position") field(DTYP, "Raw Bpm Signal") field(INP, "#C3 S9") field(SCAN, "Passive") field(PREC, "5") field(EGU, "mm") field(LOPR, "-0.7") field(HOPR, "+0.7") field(FLNK, "HL3A:SBPM:HL39:PINC") } record(ai, "HL3A:SBPM:HL39:PINC") { field(DESC, "Pin Cushion Corr.") field(DTYP, "Raw Bpm Signal") field(INP, "#C3 S10") field(SCAN, "Passive") } record(longin, "HL3A:SBPM:HL39:RSTA") { field(DESC, "Status of Raw Processor") field(DTYP, "Bpm Raw Status") field(INP, "#C3S0") field(SCAN, "1 second") field(LOLO, "-1") field(HIHI, "+1") field(HHSV, "INVALID") field(LLSV, "INVALID") field(FLNK, "HL3A:SBPM:HL39:RSTA_ALH") } record(calc, "HL3A:SBPM:HL39:RSTA_ALH") { field(CALC, "A & B") field(INPA, "HL3A:SBPM:HL39:RSTA") field(INPB, "0x30F") field(HIHI, "1") field(LOLO, "-1") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(SCAN, "Passive") } ###################################### # Input/Parameteres ###################################### record(ao, "HL3A:SBPM:HL39:PHI") { field(DESC, "Rot Angle") field(DTYP, "Soft Channel") field(VAL, "0") field(EGU, "deg") field(PREC, "1") field(LOPR, "-180") field(HOPR, "+180") field(FLNK, "HL3A:SBPM:HL39:PHI_SEQ") } record(ao, "HL3A:SBPM:HL39:PSI") { field(DESC, "Axis Sep. Angle") field(DTYP, "Soft Channel") field(VAL, "90") field(EGU, "deg") field(PREC, "1") field(LOPR, "0") field(HOPR, "+180") field(FLNK, "HL3A:SBPM:HL39:PSI_SEQ") } #record(dfanout, "HL3A:SBPM:HL39:PCMM") { # field(DESC, "BPM Scale") # field(OUTA, "HL3A:SBPM:HL39:USCL PP MS") # field(OUTB, "HL3A:SBPM:HL39:VSCL PP MS") # field(VAL, "12") # field(EGU, "mm") # field(PREC, "4") # field(LOPR, "5") # field(HOPR, "15") # field(PINI, "YES") #} record(ao, "HL3A:SBPM:HL39:UOFF") { field(DESC, "BPM U Offset") field(DTYP, "Soft Channel") field(VAL, "0") field(EGU, "mm") field(PREC, "4") field(LOPR, "-5") field(HOPR, "+5") field(FLNK, "HL3A:SBPM:HL39:UOFF_SEQ") } record(ao, "HL3A:SBPM:HL39:VOFF") { field(DESC, "BPM V Offset") field(DTYP, "Soft Channel") field(VAL, "0") field(EGU, "mm") field(PREC, "4") field(LOPR, "-5") field(HOPR, "+5") field(FLNK, "HL3A:SBPM:HL39:VOFF_SEQ") } record(ao, "HL3A:SBPM:HL39:USCL") { field(DESC, "BPM U Scale") field(DTYP, "Soft Channel") field(VAL, "1") field(EGU, "mm") field(PREC, "4") field(FLNK, "HL3A:SBPM:HL39:USCL_SEQ") } record(ao, "HL3A:SBPM:HL39:VSCL") { field(DESC, "BPM V Scale") field(DTYP, "Soft Channel") field(VAL, "1") field(EGU, "mm") field(PREC, "4") field(FLNK, "HL3A:SBPM:HL39:VSCL_SEQ") } record(mbbo, "HL3A:SBPM:HL39:ACCESS") { field(DESC, "BPM On Line") field(DTYP, "StreamSwitch") field(OUT, "#C3 S0") field(ZRVL, "1") field(ZRST, "Running") field(ZRSV, "NO_ALARM") field(ONVL, "1") field(ONST, "Maintenance") field(ONSV, "MINOR") field(TWVL, "1") field(TWST, "Test") field(TWSV, "MINOR") field(THVL, "0") field(THST, "OFFLINE") field(THSV, "MAJOR") # set both, rval and val to get it right # regardless of whether devsup does conversion # or not. field(RVAL, "0") field(VAL, "0") field(PINI, "YES") field(FLNK, "HL3A:SBPM:HL39:SIMOFF") info(autosaveFields, "RVAL") } # # 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, "HL3A:SBPM:HL39:FBCK") { field(DESC, "Feedback State") field(PINI, "YES") field(OMSL, "supervisory") field(VAL, "0") field(ZRVL, "0") field(ONVL, "1") field(TWVL, "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") info(autosaveFields, "VAL") } # Convenience record holding the MAD name record(stringin, "HL3A:SBPM:HL39:MADN") { field(DESC, "MAD Name") field(VAL, "SBPMHL39") field(PINI, "YES") } record(stringin, "SBPMHL39:NAME") { field(DESC, "BPM Name") field(VAL, "HL3A:SBPM:HL39") field(PINI, "YES") } record(ai, "HL3A:SBPM:HL39:X_SLOW") { #alias("HL3A:SBPM:HL39:X1H") field(DESC, "X snapshot for display") field(EGU, "mm") field(INP, "HL3A:SBPM:HL39:X MS") field(FLNK, "HL3A:SBPM:HL39:Y_SLOW") field(PREC, "4") field(SCAN, "1 second") field(LOPR, "-12") field(HOPR, "+12") } record(ai, "HL3A:SBPM:HL39:Y_SLOW") { #alias("HL3A:SBPM:HL39:Y1H") field(DESC, "Y snapshot for display") field(EGU, "mm") field(INP, "HL3A:SBPM:HL39:Y NPP MS") field(FLNK, "HL3A:SBPM:HL39:TMIT_SLOW") field(PREC, "4") field(LOPR, "-12") field(HOPR, "+12") } record(ai, "HL3A:SBPM:HL39:TMIT_SLOW") { #alias("HL3A:SBPM:HL39:TMIT1H") field(DESC, "TMIT snapshot for display") field(INP, "HL3A:SBPM:HL39:TMIT NPP MS") field(EGU, "Nel") field(PREC, "3") field(LOPR, "0") field(HOPR, "1E11") } ###################################### # Simulation Parameters + Control ###################################### # switch off simulation when going off-line record(calcout, "HL3A:SBPM:HL39:SIMOFF") { field(DESC, "Sim Off Propagator") field(INPA, "HL3A:SBPM:HL39:ACCESS.RVAL") field(CALC, "A") field(OCAL, "0") field(OOPT, "When Zero") field(DOPT, "Use OCAL") field(OUT, "HL3A:SBPM:HL39:SIMC PP") } record(calcout, "HL3A:SBPM:HL39:SIM") { field(DESC, "BPM Pos. Simulation") field(DTYP, "Strip Signal Simulator") field(OUT, "3") #CALC & VAL unused; the real calculation is done # in device support. The reason this is a # calcout rather than sub is that we want # to use the OUT link... field(CALC, "A") field(INPA, "HL3A:SBPM:HL39:USCL") field(INPL, "0") } # Switch simulation record HL3A:SBPM:HL39:SIMCSEQ moved to # bpmCavity.db.part and bpmStripl.db.part record(mbbo, "HL3A:SBPM:HL39:SIMC") { field(DESC, "Stripl Sim Ctl") field(DTYP, "Raw Soft Channel") field(OUT, "HL3A:SBPM:HL39:SIMCSEQ.SELN PP") field(ZRST, "OFF") field(ZRVL, "0x0f") field(ONST, "ON") field(ONVL, "0x1c0") field(TWST, "SOFT") field(TWVL, "0x030") field(MASK, "-1") field(NOBT, "16") field(VAL, "0") field(RVAL, "0x0f") field(PINI, "YES") } record(ao, "HL3A:SBPM:HL39:XSIM") { field(DESC, "BPM X Pos. Simul.") field(DTYP, "Soft Channel") field(OUT, "HL3A:SBPM:HL39:SIM.B PP") field(VAL, "0.5") field(EGU, "mm") field(PINI, "YES") field(PREC, "4") field(LOPR, "-12") field(HOPR, "+12") } record(ao, "HL3A:SBPM:HL39:YSIM") { field(DESC, "BPM Y Pos. Simul.") field(DTYP, "Soft Channel") field(OUT, "HL3A:SBPM:HL39:SIM.C PP") field(VAL, "0.") field(EGU, "mm") field(PINI, "YES") field(PREC, "4") field(LOPR, "-12") field(HOPR, "+12") } record(ao, "HL3A:SBPM:HL39:QSIM") { field(DESC, "BPM Q Simul.") field(DTYP, "Raw Soft Channel") field(OUT, "HL3A:SBPM:HL39:SIM.D PP") field(EGU, "Nel") field(ASLO, "6000") #ESLO is used to add attenuation field(LINR, "LINEAR") field(VAL, "1E9") field(PINI, "YES") field(PREC, "4") field(LOPR, "0") field(HOPR, "1E11") } record(ao, "HL3A:SBPM:HL39:ROTS") { field(DESC, "BPM Rot. Simul.") field(DTYP, "Soft Channel") field(OUT, "HL3A:SBPM:HL39:SIM.E PP") field(VAL, "0.") field(EGU, "deg") field(PINI, "YES") field(PREC, "1") field(LOPR, "-180") } record(ao, "HL3A:SBPM:HL39:PSIS") { field(DESC, "BPM Angle. Simul.") field(DTYP, "Soft Channel") field(OUT, "HL3A:SBPM:HL39:SIM.F PP") field(VAL, "90") field(EGU, "deg") field(PINI, "YES") field(PREC, "1") field(LOPR, "0") } record(aao, "HL3A:SBPM:HL39:DIGISIMW") { field(DESC, "VME Digi Sim. Waveform") field(DTYP, "VmeDigi Sim Wav") field(OUT, "#C3 S0") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32678") field(LOPR, "-32768") # 16384 samples/channel * 4 channels field(NELM, "65536") field(PINI, "NO") } #Used by model/database folks to verify BPM record(ao, "HL3A:SBPM:HL39:Z") { field(DESC, "Z Position") field(PINI, "YES") info(autosaveFields, "VAL") } # MPS interface record(bo, "HL3A:SBPM:HL39:MPSBYP") { field(DESC, "MPS Bypass") field(DTYP, "BusAddress") field(OUT, "#C0S2@bpmMPS+0,m32") field(MASK, "8") field(ZNAM, "BYPASSED") field(ONAM, "NOT_BYPASSED") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(VAL, "0") field(PINI, "YES") field(ASG, "") info(autosaveFields, "VAL") } record(bo, "HL3A:SBPM:HL39:MPSLTBYP") { field(DESC, "MPS Bypass") field(DTYP, "BusAddress") field(OUT, "#C1S2@bpmMPS+0,m32") field(MASK, "8") field(ZNAM, "BYPASSED") field(ONAM, "NOT_BYPASSED") field(ZSV, "NO_ALARM") field(OSV, "NO_ALARM") field(VAL, "0") field(PINI, "YES") field(ASG, "") info(autosaveFields, "VAL") } record(calc, "HL3A:SBPM:HL39:MPSIGNRCALC") { field(DESC, "MPS ignore if TMIT too low") field(CALC, "A $[parm]_SEQ # # Different values of the parameter # $[parm0]..$[parm9] are stored in # $[parm]_SEL.A .. $[parm]_SEL.J # # The actual value of the parameter is # selected based on the value of a controlling # PV $[ctrl] using a 'mapping' CALC expression # $[mapc] to convert the $[ctrl] value into # the integer range 1..10. # # The selected value of $[parm] is written # to output link $[outl] # # A) When the user writes $[parm] then # its value is deposited in the currently # selected field of $[parm]_SEL and # propagated to $[outl] # # B) When the user writes any of $[parm]_SEL.A..J # then the value is stored there. If she # writes to the currently 'active' field\ # (as selected by $[ctrl]) then # the $[parm] PV itself is updated and the # value is also propagated to $[outl] # # C) If the user changes $[ctrl] then the # corresponding value $[parm]_SEL.A..J is # propagated to $[outl] and $[parm]. # # D) At initialization, the value corresponding # to the initial setting of $[ctrl] is written # to $[outl] and $[parm] # # MACROS: # # $[parm] PV holding the parameter # $[ctrl] PV that controls the selection of # the currently active setting of # $[parm] # $[outl] PV where the currently selected # value of $[parm] shall be written-to # (if applicable) # $[prec] Precision of the $[parm]_SEL variable # (should be set to same value as $[parm].PREC) # # $[parm0]..$[parm9] initial values of $[parm] # # $[mapc] CALC expression to convert the value # of the controlling PV which is available # as 'A' to the range 1..10 (or less if # less selections are used). # E.g., to convert the value of a bo (0/1) # you would set mapc to 'A+1' (0..1 -> 1..2) # # NOTE: This sb snippet is loaded/expanded # for every parameter under control # of $[ctrl]. ALSO, the companion # snippet parmCtl.db must be loaded/expanded # but only once per controlling PV. # # This record, when scanned (as a result # of $[parm] being written and processing # its FLNK to this record] fetches $[parm] # and deposits the value into the currently # selected field of the SEL record. # # NOTE: unfortunately, the selection # mechanism of the SEQ and SEL # records differs: SEQ is 1-based, # SEL is 0-based -- now that makes # sense, doesn't it? # record(seq, "HL3A:SBPM:HL39:UOFF_SEQ") { field(DESC, "Propagate Parm -> SEL") field(DOL1, "HL3A:SBPM:HL39:UOFF") field(DOL2, "HL3A:SBPM:HL39:UOFF") field(DOL3, "HL3A:SBPM:HL39:UOFF") field(DOL4, "HL3A:SBPM:HL39:UOFF") field(DOL5, "HL3A:SBPM:HL39:UOFF") field(DOL6, "HL3A:SBPM:HL39:UOFF") field(DOL7, "HL3A:SBPM:HL39:UOFF") field(DOL8, "HL3A:SBPM:HL39:UOFF") field(DOL9, "HL3A:SBPM:HL39:UOFF") field(DOLA, "HL3A:SBPM:HL39:UOFF") field(LNK1, "HL3A:SBPM:HL39:UOFF_SEL.A PP") field(LNK2, "HL3A:SBPM:HL39:UOFF_SEL.B PP") field(LNK3, "HL3A:SBPM:HL39:UOFF_SEL.C PP") field(LNK4, "HL3A:SBPM:HL39:UOFF_SEL.D PP") field(LNK5, "HL3A:SBPM:HL39:UOFF_SEL.E PP") field(LNK6, "HL3A:SBPM:HL39:UOFF_SEL.F PP") field(LNK7, "HL3A:SBPM:HL39:UOFF_SEL.G PP") field(LNK8, "HL3A:SBPM:HL39:UOFF_SEL.H PP") field(LNK9, "HL3A:SBPM:HL39:UOFF_SEL.I PP") field(LNKA, "HL3A:SBPM:HL39:UOFF_SEL.J PP") field(SELM, "Specified") field(SELL, "HL3A:SBPM:HL39:UOFF_CTRL NPP NMS") } # The $[parm]_SEL record holds all possible # values of $[parm] in the 'A..J' fields. # # When processed it updates it's own VAL # to the currently selected input. Input # 'L' serves as the (1-based) selector, # i.e., L==1 selects 'A'->'VAL'. # # When the selected value changes (as a # result of SEQ depositing a new value OR # $[ctrl] changing and updating L) then # the propagator record attached to the # FLNK is processed. # record(sub, "HL3A:SBPM:HL39:UOFF_SEL") { # field(INAM, "parmSelSubInit") field(SNAM, "parmSelSubProc") field(A, "0") field(B, "0") field(C, "") field(D, "") field(E, "") field(F, "") field(G, "") field(H, "") field(I, "") field(J, "") field(PREC, "4") field(FLNK, "HL3A:SBPM:HL39:UOFF_PROP") info(autosaveFields, "A B C D E F G H I J") } # # Finally the dfanout record # fetches the currently selected # value from SEL and propagates it # to $[outl]. It also updates # $[parm] itself so that $[parm] # always reflects the currently # selected value. # record(dfanout, "HL3A:SBPM:HL39:UOFF_PROP") { field(OMSL, "closed_loop") field(DOL, "HL3A:SBPM:HL39:UOFF_SEL") field(OUTA, "HL3A:SBPM:HL39:U.AOFF CA") field(OUTB, "HL3A:SBPM:HL39:UOFF PP") } # Drive the SEL record when the 'ctrl' PV changes # Use a CA link to monitor such changes record(calcout, "HL3A:SBPM:HL39:UOFF_CTRL") { field(INPA, "HL3A:SBPM:HL39:PARMSEL CP") field(CALC, "A+1") field(DOPT, "Use CALC") field(OOPT, "On Change") field(OUT, "HL3A:SBPM:HL39:UOFF_SEL.L PP") } # Maintain multiple (up to 10) values of # a parameter: # # Record holding the parameter $[parm] # must FLNK -> $[parm]_SEQ # # Different values of the parameter # $[parm0]..$[parm9] are stored in # $[parm]_SEL.A .. $[parm]_SEL.J # # The actual value of the parameter is # selected based on the value of a controlling # PV $[ctrl] using a 'mapping' CALC expression # $[mapc] to convert the $[ctrl] value into # the integer range 1..10. # # The selected value of $[parm] is written # to output link $[outl] # # A) When the user writes $[parm] then # its value is deposited in the currently # selected field of $[parm]_SEL and # propagated to $[outl] # # B) When the user writes any of $[parm]_SEL.A..J # then the value is stored there. If she # writes to the currently 'active' field\ # (as selected by $[ctrl]) then # the $[parm] PV itself is updated and the # value is also propagated to $[outl] # # C) If the user changes $[ctrl] then the # corresponding value $[parm]_SEL.A..J is # propagated to $[outl] and $[parm]. # # D) At initialization, the value corresponding # to the initial setting of $[ctrl] is written # to $[outl] and $[parm] # # MACROS: # # $[parm] PV holding the parameter # $[ctrl] PV that controls the selection of # the currently active setting of # $[parm] # $[outl] PV where the currently selected # value of $[parm] shall be written-to # (if applicable) # $[prec] Precision of the $[parm]_SEL variable # (should be set to same value as $[parm].PREC) # # $[parm0]..$[parm9] initial values of $[parm] # # $[mapc] CALC expression to convert the value # of the controlling PV which is available # as 'A' to the range 1..10 (or less if # less selections are used). # E.g., to convert the value of a bo (0/1) # you would set mapc to 'A+1' (0..1 -> 1..2) # # NOTE: This sb snippet is loaded/expanded # for every parameter under control # of $[ctrl]. ALSO, the companion # snippet parmCtl.db must be loaded/expanded # but only once per controlling PV. # # This record, when scanned (as a result # of $[parm] being written and processing # its FLNK to this record] fetches $[parm] # and deposits the value into the currently # selected field of the SEL record. # # NOTE: unfortunately, the selection # mechanism of the SEQ and SEL # records differs: SEQ is 1-based, # SEL is 0-based -- now that makes # sense, doesn't it? # record(seq, "HL3A:SBPM:HL39:VOFF_SEQ") { field(DESC, "Propagate Parm -> SEL") field(DOL1, "HL3A:SBPM:HL39:VOFF") field(DOL2, "HL3A:SBPM:HL39:VOFF") field(DOL3, "HL3A:SBPM:HL39:VOFF") field(DOL4, "HL3A:SBPM:HL39:VOFF") field(DOL5, "HL3A:SBPM:HL39:VOFF") field(DOL6, "HL3A:SBPM:HL39:VOFF") field(DOL7, "HL3A:SBPM:HL39:VOFF") field(DOL8, "HL3A:SBPM:HL39:VOFF") field(DOL9, "HL3A:SBPM:HL39:VOFF") field(DOLA, "HL3A:SBPM:HL39:VOFF") field(LNK1, "HL3A:SBPM:HL39:VOFF_SEL.A PP") field(LNK2, "HL3A:SBPM:HL39:VOFF_SEL.B PP") field(LNK3, "HL3A:SBPM:HL39:VOFF_SEL.C PP") field(LNK4, "HL3A:SBPM:HL39:VOFF_SEL.D PP") field(LNK5, "HL3A:SBPM:HL39:VOFF_SEL.E PP") field(LNK6, "HL3A:SBPM:HL39:VOFF_SEL.F PP") field(LNK7, "HL3A:SBPM:HL39:VOFF_SEL.G PP") field(LNK8, "HL3A:SBPM:HL39:VOFF_SEL.H PP") field(LNK9, "HL3A:SBPM:HL39:VOFF_SEL.I PP") field(LNKA, "HL3A:SBPM:HL39:VOFF_SEL.J PP") field(SELM, "Specified") field(SELL, "HL3A:SBPM:HL39:VOFF_CTRL NPP NMS") } # The $[parm]_SEL record holds all possible # values of $[parm] in the 'A..J' fields. # # When processed it updates it's own VAL # to the currently selected input. Input # 'L' serves as the (1-based) selector, # i.e., L==1 selects 'A'->'VAL'. # # When the selected value changes (as a # result of SEQ depositing a new value OR # $[ctrl] changing and updating L) then # the propagator record attached to the # FLNK is processed. # record(sub, "HL3A:SBPM:HL39:VOFF_SEL") { # field(INAM, "parmSelSubInit") field(SNAM, "parmSelSubProc") field(A, "0") field(B, "0") field(C, "") field(D, "") field(E, "") field(F, "") field(G, "") field(H, "") field(I, "") field(J, "") field(PREC, "4") field(FLNK, "HL3A:SBPM:HL39:VOFF_PROP") info(autosaveFields, "A B C D E F G H I J") } # # Finally the dfanout record # fetches the currently selected # value from SEL and propagates it # to $[outl]. It also updates # $[parm] itself so that $[parm] # always reflects the currently # selected value. # record(dfanout, "HL3A:SBPM:HL39:VOFF_PROP") { field(OMSL, "closed_loop") field(DOL, "HL3A:SBPM:HL39:VOFF_SEL") field(OUTA, "HL3A:SBPM:HL39:V.AOFF CA") field(OUTB, "HL3A:SBPM:HL39:VOFF PP") } # Drive the SEL record when the 'ctrl' PV changes # Use a CA link to monitor such changes record(calcout, "HL3A:SBPM:HL39:VOFF_CTRL") { field(INPA, "HL3A:SBPM:HL39:PARMSEL CP") field(CALC, "A+1") field(DOPT, "Use CALC") field(OOPT, "On Change") field(OUT, "HL3A:SBPM:HL39:VOFF_SEL.L PP") } # Maintain multiple (up to 10) values of # a parameter: # # Record holding the parameter $[parm] # must FLNK -> $[parm]_SEQ # # Different values of the parameter # $[parm0]..$[parm9] are stored in # $[parm]_SEL.A .. $[parm]_SEL.J # # The actual value of the parameter is # selected based on the value of a controlling # PV $[ctrl] using a 'mapping' CALC expression # $[mapc] to convert the $[ctrl] value into # the integer range 1..10. # # The selected value of $[parm] is written # to output link $[outl] # # A) When the user writes $[parm] then # its value is deposited in the currently # selected field of $[parm]_SEL and # propagated to $[outl] # # B) When the user writes any of $[parm]_SEL.A..J # then the value is stored there. If she # writes to the currently 'active' field\ # (as selected by $[ctrl]) then # the $[parm] PV itself is updated and the # value is also propagated to $[outl] # # C) If the user changes $[ctrl] then the # corresponding value $[parm]_SEL.A..J is # propagated to $[outl] and $[parm]. # # D) At initialization, the value corresponding # to the initial setting of $[ctrl] is written # to $[outl] and $[parm] # # MACROS: # # $[parm] PV holding the parameter # $[ctrl] PV that controls the selection of # the currently active setting of # $[parm] # $[outl] PV where the currently selected # value of $[parm] shall be written-to # (if applicable) # $[prec] Precision of the $[parm]_SEL variable # (should be set to same value as $[parm].PREC) # # $[parm0]..$[parm9] initial values of $[parm] # # $[mapc] CALC expression to convert the value # of the controlling PV which is available # as 'A' to the range 1..10 (or less if # less selections are used). # E.g., to convert the value of a bo (0/1) # you would set mapc to 'A+1' (0..1 -> 1..2) # # NOTE: This sb snippet is loaded/expanded # for every parameter under control # of $[ctrl]. ALSO, the companion # snippet parmCtl.db must be loaded/expanded # but only once per controlling PV. # # This record, when scanned (as a result # of $[parm] being written and processing # its FLNK to this record] fetches $[parm] # and deposits the value into the currently # selected field of the SEL record. # # NOTE: unfortunately, the selection # mechanism of the SEQ and SEL # records differs: SEQ is 1-based, # SEL is 0-based -- now that makes # sense, doesn't it? # record(seq, "HL3A:SBPM:HL39:USCL_SEQ") { field(DESC, "Propagate Parm -> SEL") field(DOL1, "HL3A:SBPM:HL39:USCL") field(DOL2, "HL3A:SBPM:HL39:USCL") field(DOL3, "HL3A:SBPM:HL39:USCL") field(DOL4, "HL3A:SBPM:HL39:USCL") field(DOL5, "HL3A:SBPM:HL39:USCL") field(DOL6, "HL3A:SBPM:HL39:USCL") field(DOL7, "HL3A:SBPM:HL39:USCL") field(DOL8, "HL3A:SBPM:HL39:USCL") field(DOL9, "HL3A:SBPM:HL39:USCL") field(DOLA, "HL3A:SBPM:HL39:USCL") field(LNK1, "HL3A:SBPM:HL39:USCL_SEL.A PP") field(LNK2, "HL3A:SBPM:HL39:USCL_SEL.B PP") field(LNK3, "HL3A:SBPM:HL39:USCL_SEL.C PP") field(LNK4, "HL3A:SBPM:HL39:USCL_SEL.D PP") field(LNK5, "HL3A:SBPM:HL39:USCL_SEL.E PP") field(LNK6, "HL3A:SBPM:HL39:USCL_SEL.F PP") field(LNK7, "HL3A:SBPM:HL39:USCL_SEL.G PP") field(LNK8, "HL3A:SBPM:HL39:USCL_SEL.H PP") field(LNK9, "HL3A:SBPM:HL39:USCL_SEL.I PP") field(LNKA, "HL3A:SBPM:HL39:USCL_SEL.J PP") field(SELM, "Specified") field(SELL, "HL3A:SBPM:HL39:USCL_CTRL NPP NMS") } # The $[parm]_SEL record holds all possible # values of $[parm] in the 'A..J' fields. # # When processed it updates it's own VAL # to the currently selected input. Input # 'L' serves as the (1-based) selector, # i.e., L==1 selects 'A'->'VAL'. # # When the selected value changes (as a # result of SEQ depositing a new value OR # $[ctrl] changing and updating L) then # the propagator record attached to the # FLNK is processed. # record(sub, "HL3A:SBPM:HL39:USCL_SEL") { # field(INAM, "parmSelSubInit") field(SNAM, "parmSelSubProc") field(A, "1") field(B, "1") field(C, "") field(D, "") field(E, "") field(F, "") field(G, "") field(H, "") field(I, "") field(J, "") field(PREC, "4") field(FLNK, "HL3A:SBPM:HL39:USCL_PROP") info(autosaveFields, "A B C D E F G H I J") } # # Finally the dfanout record # fetches the currently selected # value from SEL and propagates it # to $[outl]. It also updates # $[parm] itself so that $[parm] # always reflects the currently # selected value. # record(dfanout, "HL3A:SBPM:HL39:USCL_PROP") { field(OMSL, "closed_loop") field(DOL, "HL3A:SBPM:HL39:USCL_SEL") field(OUTA, "HL3A:SBPM:HL39:U.ASLO CA") field(OUTB, "HL3A:SBPM:HL39:USCL PP") } # Drive the SEL record when the 'ctrl' PV changes # Use a CA link to monitor such changes record(calcout, "HL3A:SBPM:HL39:USCL_CTRL") { field(INPA, "HL3A:SBPM:HL39:PARMSEL CP") field(CALC, "A+1") field(DOPT, "Use CALC") field(OOPT, "On Change") field(OUT, "HL3A:SBPM:HL39:USCL_SEL.L PP") } # Maintain multiple (up to 10) values of # a parameter: # # Record holding the parameter $[parm] # must FLNK -> $[parm]_SEQ # # Different values of the parameter # $[parm0]..$[parm9] are stored in # $[parm]_SEL.A .. $[parm]_SEL.J # # The actual value of the parameter is # selected based on the value of a controlling # PV $[ctrl] using a 'mapping' CALC expression # $[mapc] to convert the $[ctrl] value into # the integer range 1..10. # # The selected value of $[parm] is written # to output link $[outl] # # A) When the user writes $[parm] then # its value is deposited in the currently # selected field of $[parm]_SEL and # propagated to $[outl] # # B) When the user writes any of $[parm]_SEL.A..J # then the value is stored there. If she # writes to the currently 'active' field\ # (as selected by $[ctrl]) then # the $[parm] PV itself is updated and the # value is also propagated to $[outl] # # C) If the user changes $[ctrl] then the # corresponding value $[parm]_SEL.A..J is # propagated to $[outl] and $[parm]. # # D) At initialization, the value corresponding # to the initial setting of $[ctrl] is written # to $[outl] and $[parm] # # MACROS: # # $[parm] PV holding the parameter # $[ctrl] PV that controls the selection of # the currently active setting of # $[parm] # $[outl] PV where the currently selected # value of $[parm] shall be written-to # (if applicable) # $[prec] Precision of the $[parm]_SEL variable # (should be set to same value as $[parm].PREC) # # $[parm0]..$[parm9] initial values of $[parm] # # $[mapc] CALC expression to convert the value # of the controlling PV which is available # as 'A' to the range 1..10 (or less if # less selections are used). # E.g., to convert the value of a bo (0/1) # you would set mapc to 'A+1' (0..1 -> 1..2) # # NOTE: This sb snippet is loaded/expanded # for every parameter under control # of $[ctrl]. ALSO, the companion # snippet parmCtl.db must be loaded/expanded # but only once per controlling PV. # # This record, when scanned (as a result # of $[parm] being written and processing # its FLNK to this record] fetches $[parm] # and deposits the value into the currently # selected field of the SEL record. # # NOTE: unfortunately, the selection # mechanism of the SEQ and SEL # records differs: SEQ is 1-based, # SEL is 0-based -- now that makes # sense, doesn't it? # record(seq, "HL3A:SBPM:HL39:VSCL_SEQ") { field(DESC, "Propagate Parm -> SEL") field(DOL1, "HL3A:SBPM:HL39:VSCL") field(DOL2, "HL3A:SBPM:HL39:VSCL") field(DOL3, "HL3A:SBPM:HL39:VSCL") field(DOL4, "HL3A:SBPM:HL39:VSCL") field(DOL5, "HL3A:SBPM:HL39:VSCL") field(DOL6, "HL3A:SBPM:HL39:VSCL") field(DOL7, "HL3A:SBPM:HL39:VSCL") field(DOL8, "HL3A:SBPM:HL39:VSCL") field(DOL9, "HL3A:SBPM:HL39:VSCL") field(DOLA, "HL3A:SBPM:HL39:VSCL") field(LNK1, "HL3A:SBPM:HL39:VSCL_SEL.A PP") field(LNK2, "HL3A:SBPM:HL39:VSCL_SEL.B PP") field(LNK3, "HL3A:SBPM:HL39:VSCL_SEL.C PP") field(LNK4, "HL3A:SBPM:HL39:VSCL_SEL.D PP") field(LNK5, "HL3A:SBPM:HL39:VSCL_SEL.E PP") field(LNK6, "HL3A:SBPM:HL39:VSCL_SEL.F PP") field(LNK7, "HL3A:SBPM:HL39:VSCL_SEL.G PP") field(LNK8, "HL3A:SBPM:HL39:VSCL_SEL.H PP") field(LNK9, "HL3A:SBPM:HL39:VSCL_SEL.I PP") field(LNKA, "HL3A:SBPM:HL39:VSCL_SEL.J PP") field(SELM, "Specified") field(SELL, "HL3A:SBPM:HL39:VSCL_CTRL NPP NMS") } # The $[parm]_SEL record holds all possible # values of $[parm] in the 'A..J' fields. # # When processed it updates it's own VAL # to the currently selected input. Input # 'L' serves as the (1-based) selector, # i.e., L==1 selects 'A'->'VAL'. # # When the selected value changes (as a # result of SEQ depositing a new value OR # $[ctrl] changing and updating L) then # the propagator record attached to the # FLNK is processed. # record(sub, "HL3A:SBPM:HL39:VSCL_SEL") { # field(INAM, "parmSelSubInit") field(SNAM, "parmSelSubProc") field(A, "1") field(B, "1") field(C, "") field(D, "") field(E, "") field(F, "") field(G, "") field(H, "") field(I, "") field(J, "") field(PREC, "4") field(FLNK, "HL3A:SBPM:HL39:VSCL_PROP") info(autosaveFields, "A B C D E F G H I J") } # # Finally the dfanout record # fetches the currently selected # value from SEL and propagates it # to $[outl]. It also updates # $[parm] itself so that $[parm] # always reflects the currently # selected value. # record(dfanout, "HL3A:SBPM:HL39:VSCL_PROP") { field(OMSL, "closed_loop") field(DOL, "HL3A:SBPM:HL39:VSCL_SEL") field(OUTA, "HL3A:SBPM:HL39:V.ASLO CA") field(OUTB, "HL3A:SBPM:HL39:VSCL PP") } # Drive the SEL record when the 'ctrl' PV changes # Use a CA link to monitor such changes record(calcout, "HL3A:SBPM:HL39:VSCL_CTRL") { field(INPA, "HL3A:SBPM:HL39:PARMSEL CP") field(CALC, "A+1") field(DOPT, "Use CALC") field(OOPT, "On Change") field(OUT, "HL3A:SBPM:HL39:VSCL_SEL.L PP") } # Maintain multiple (up to 10) values of # a parameter: # # Record holding the parameter $[parm] # must FLNK -> $[parm]_SEQ # # Different values of the parameter # $[parm0]..$[parm9] are stored in # $[parm]_SEL.A .. $[parm]_SEL.J # # The actual value of the parameter is # selected based on the value of a controlling # PV $[ctrl] using a 'mapping' CALC expression # $[mapc] to convert the $[ctrl] value into # the integer range 1..10. # # The selected value of $[parm] is written # to output link $[outl] # # A) When the user writes $[parm] then # its value is deposited in the currently # selected field of $[parm]_SEL and # propagated to $[outl] # # B) When the user writes any of $[parm]_SEL.A..J # then the value is stored there. If she # writes to the currently 'active' field\ # (as selected by $[ctrl]) then # the $[parm] PV itself is updated and the # value is also propagated to $[outl] # # C) If the user changes $[ctrl] then the # corresponding value $[parm]_SEL.A..J is # propagated to $[outl] and $[parm]. # # D) At initialization, the value corresponding # to the initial setting of $[ctrl] is written # to $[outl] and $[parm] # # MACROS: # # $[parm] PV holding the parameter # $[ctrl] PV that controls the selection of # the currently active setting of # $[parm] # $[outl] PV where the currently selected # value of $[parm] shall be written-to # (if applicable) # $[prec] Precision of the $[parm]_SEL variable # (should be set to same value as $[parm].PREC) # # $[parm0]..$[parm9] initial values of $[parm] # # $[mapc] CALC expression to convert the value # of the controlling PV which is available # as 'A' to the range 1..10 (or less if # less selections are used). # E.g., to convert the value of a bo (0/1) # you would set mapc to 'A+1' (0..1 -> 1..2) # # NOTE: This sb snippet is loaded/expanded # for every parameter under control # of $[ctrl]. ALSO, the companion # snippet parmCtl.db must be loaded/expanded # but only once per controlling PV. # # This record, when scanned (as a result # of $[parm] being written and processing # its FLNK to this record] fetches $[parm] # and deposits the value into the currently # selected field of the SEL record. # # NOTE: unfortunately, the selection # mechanism of the SEQ and SEL # records differs: SEQ is 1-based, # SEL is 0-based -- now that makes # sense, doesn't it? # record(seq, "HL3A:SBPM:HL39:PHI_SEQ") { field(DESC, "Propagate Parm -> SEL") field(DOL1, "HL3A:SBPM:HL39:PHI") field(DOL2, "HL3A:SBPM:HL39:PHI") field(DOL3, "HL3A:SBPM:HL39:PHI") field(DOL4, "HL3A:SBPM:HL39:PHI") field(DOL5, "HL3A:SBPM:HL39:PHI") field(DOL6, "HL3A:SBPM:HL39:PHI") field(DOL7, "HL3A:SBPM:HL39:PHI") field(DOL8, "HL3A:SBPM:HL39:PHI") field(DOL9, "HL3A:SBPM:HL39:PHI") field(DOLA, "HL3A:SBPM:HL39:PHI") field(LNK1, "HL3A:SBPM:HL39:PHI_SEL.A PP") field(LNK2, "HL3A:SBPM:HL39:PHI_SEL.B PP") field(LNK3, "HL3A:SBPM:HL39:PHI_SEL.C PP") field(LNK4, "HL3A:SBPM:HL39:PHI_SEL.D PP") field(LNK5, "HL3A:SBPM:HL39:PHI_SEL.E PP") field(LNK6, "HL3A:SBPM:HL39:PHI_SEL.F PP") field(LNK7, "HL3A:SBPM:HL39:PHI_SEL.G PP") field(LNK8, "HL3A:SBPM:HL39:PHI_SEL.H PP") field(LNK9, "HL3A:SBPM:HL39:PHI_SEL.I PP") field(LNKA, "HL3A:SBPM:HL39:PHI_SEL.J PP") field(SELM, "Specified") field(SELL, "HL3A:SBPM:HL39:PHI_CTRL NPP NMS") } # The $[parm]_SEL record holds all possible # values of $[parm] in the 'A..J' fields. # # When processed it updates it's own VAL # to the currently selected input. Input # 'L' serves as the (1-based) selector, # i.e., L==1 selects 'A'->'VAL'. # # When the selected value changes (as a # result of SEQ depositing a new value OR # $[ctrl] changing and updating L) then # the propagator record attached to the # FLNK is processed. # record(sub, "HL3A:SBPM:HL39:PHI_SEL") { # field(INAM, "parmSelSubInit") field(SNAM, "parmSelSubProc") field(A, "0") field(B, "0") field(C, "") field(D, "") field(E, "") field(F, "") field(G, "") field(H, "") field(I, "") field(J, "") field(PREC, "1") field(FLNK, "HL3A:SBPM:HL39:PHI_PROP") info(autosaveFields, "A B C D E F G H I J") } # # Finally the dfanout record # fetches the currently selected # value from SEL and propagates it # to $[outl]. It also updates # $[parm] itself so that $[parm] # always reflects the currently # selected value. # record(dfanout, "HL3A:SBPM:HL39:PHI_PROP") { field(OMSL, "closed_loop") field(DOL, "HL3A:SBPM:HL39:PHI_SEL") field(OUTA, "HL3A:SBPM:HL39:CALC.E CA") field(OUTB, "HL3A:SBPM:HL39:PHI PP") } # Drive the SEL record when the 'ctrl' PV changes # Use a CA link to monitor such changes record(calcout, "HL3A:SBPM:HL39:PHI_CTRL") { field(INPA, "HL3A:SBPM:HL39:PARMSEL CP") field(CALC, "A+1") field(DOPT, "Use CALC") field(OOPT, "On Change") field(OUT, "HL3A:SBPM:HL39:PHI_SEL.L PP") } # Maintain multiple (up to 10) values of # a parameter: # # Record holding the parameter $[parm] # must FLNK -> $[parm]_SEQ # # Different values of the parameter # $[parm0]..$[parm9] are stored in # $[parm]_SEL.A .. $[parm]_SEL.J # # The actual value of the parameter is # selected based on the value of a controlling # PV $[ctrl] using a 'mapping' CALC expression # $[mapc] to convert the $[ctrl] value into # the integer range 1..10. # # The selected value of $[parm] is written # to output link $[outl] # # A) When the user writes $[parm] then # its value is deposited in the currently # selected field of $[parm]_SEL and # propagated to $[outl] # # B) When the user writes any of $[parm]_SEL.A..J # then the value is stored there. If she # writes to the currently 'active' field\ # (as selected by $[ctrl]) then # the $[parm] PV itself is updated and the # value is also propagated to $[outl] # # C) If the user changes $[ctrl] then the # corresponding value $[parm]_SEL.A..J is # propagated to $[outl] and $[parm]. # # D) At initialization, the value corresponding # to the initial setting of $[ctrl] is written # to $[outl] and $[parm] # # MACROS: # # $[parm] PV holding the parameter # $[ctrl] PV that controls the selection of # the currently active setting of # $[parm] # $[outl] PV where the currently selected # value of $[parm] shall be written-to # (if applicable) # $[prec] Precision of the $[parm]_SEL variable # (should be set to same value as $[parm].PREC) # # $[parm0]..$[parm9] initial values of $[parm] # # $[mapc] CALC expression to convert the value # of the controlling PV which is available # as 'A' to the range 1..10 (or less if # less selections are used). # E.g., to convert the value of a bo (0/1) # you would set mapc to 'A+1' (0..1 -> 1..2) # # NOTE: This sb snippet is loaded/expanded # for every parameter under control # of $[ctrl]. ALSO, the companion # snippet parmCtl.db must be loaded/expanded # but only once per controlling PV. # # This record, when scanned (as a result # of $[parm] being written and processing # its FLNK to this record] fetches $[parm] # and deposits the value into the currently # selected field of the SEL record. # # NOTE: unfortunately, the selection # mechanism of the SEQ and SEL # records differs: SEQ is 1-based, # SEL is 0-based -- now that makes # sense, doesn't it? # record(seq, "HL3A:SBPM:HL39:PSI_SEQ") { field(DESC, "Propagate Parm -> SEL") field(DOL1, "HL3A:SBPM:HL39:PSI") field(DOL2, "HL3A:SBPM:HL39:PSI") field(DOL3, "HL3A:SBPM:HL39:PSI") field(DOL4, "HL3A:SBPM:HL39:PSI") field(DOL5, "HL3A:SBPM:HL39:PSI") field(DOL6, "HL3A:SBPM:HL39:PSI") field(DOL7, "HL3A:SBPM:HL39:PSI") field(DOL8, "HL3A:SBPM:HL39:PSI") field(DOL9, "HL3A:SBPM:HL39:PSI") field(DOLA, "HL3A:SBPM:HL39:PSI") field(LNK1, "HL3A:SBPM:HL39:PSI_SEL.A PP") field(LNK2, "HL3A:SBPM:HL39:PSI_SEL.B PP") field(LNK3, "HL3A:SBPM:HL39:PSI_SEL.C PP") field(LNK4, "HL3A:SBPM:HL39:PSI_SEL.D PP") field(LNK5, "HL3A:SBPM:HL39:PSI_SEL.E PP") field(LNK6, "HL3A:SBPM:HL39:PSI_SEL.F PP") field(LNK7, "HL3A:SBPM:HL39:PSI_SEL.G PP") field(LNK8, "HL3A:SBPM:HL39:PSI_SEL.H PP") field(LNK9, "HL3A:SBPM:HL39:PSI_SEL.I PP") field(LNKA, "HL3A:SBPM:HL39:PSI_SEL.J PP") field(SELM, "Specified") field(SELL, "HL3A:SBPM:HL39:PSI_CTRL NPP NMS") } # The $[parm]_SEL record holds all possible # values of $[parm] in the 'A..J' fields. # # When processed it updates it's own VAL # to the currently selected input. Input # 'L' serves as the (1-based) selector, # i.e., L==1 selects 'A'->'VAL'. # # When the selected value changes (as a # result of SEQ depositing a new value OR # $[ctrl] changing and updating L) then # the propagator record attached to the # FLNK is processed. # record(sub, "HL3A:SBPM:HL39:PSI_SEL") { # field(INAM, "parmSelSubInit") field(SNAM, "parmSelSubProc") field(A, "90") field(B, "90") field(C, "") field(D, "") field(E, "") field(F, "") field(G, "") field(H, "") field(I, "") field(J, "") field(PREC, "1") field(FLNK, "HL3A:SBPM:HL39:PSI_PROP") info(autosaveFields, "A B C D E F G H I J") } # # Finally the dfanout record # fetches the currently selected # value from SEL and propagates it # to $[outl]. It also updates # $[parm] itself so that $[parm] # always reflects the currently # selected value. # record(dfanout, "HL3A:SBPM:HL39:PSI_PROP") { field(OMSL, "closed_loop") field(DOL, "HL3A:SBPM:HL39:PSI_SEL") field(OUTA, "HL3A:SBPM:HL39:CALC.F CA") field(OUTB, "HL3A:SBPM:HL39:PSI PP") } # Drive the SEL record when the 'ctrl' PV changes # Use a CA link to monitor such changes record(calcout, "HL3A:SBPM:HL39:PSI_CTRL") { field(INPA, "HL3A:SBPM:HL39:PARMSEL CP") field(CALC, "A+1") field(DOPT, "Use CALC") field(OOPT, "On Change") field(OUT, "HL3A:SBPM:HL39:PSI_SEL.L PP") } record(longout, "HL3A:SBPM:HL39:PARMSEL") { field(VAL, "0") field(PINI, "YES") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBDEND # per BPM database for stripline BPMs ############################################## # This is the head of the main processing chain # that runs at the highest priority. ############################################## ############################################# # This is the head of the processing chain for # diagnostics. ############################################## record(ai, "HL3A:SBPM:HL40:GRN") { field(DESC, "GRN Strip Amplitude") field(DTYP, "Raw Bpm Signal") # 'card' selects PAD number, 'signal' selects strip field(INP, "#C4 S0") field(EGU, "raw") #TODO set HOPR/LOPR, alarm limits field(SCAN, "I/O Intr") # The priority determines what scan list we are being # put on (see drvPadUdpComm.c) field(PRIO, "LOW") field(FLNK, "HL3A:SBPM:HL40:RED") # HOPR for the energy algorithm is determined as follows: # # inf inf # 1) Fourier relation / h^2 dt = / |H|^2 df = 2 B # 0 -inf # # 1a) It can be shown that the maximum of the impuls response # ha is ~ 2 B # # 2) The digitizer produces the numbers # # Ai = 2^s (hi/ha) # # where ha is the maximum of the impuls response # and 2^s is a scale factor. # # 3) 'Energy algorithm' calculates S = sum( Ai^2 ) # # inf # 4) S = (2^s / ha)^2 sum(hi^2) = K sum(hi^2) Dt ~ K / h^2 dt # 0 # # with K = (2^s / ha)^2 fs # # 5) From 4) and 1a) -> S ~ K ha and therefore # # 6) S = 2^(2s) fs/ha = 2^(2s) fs/(2 B) # # 7) The strip signals are sqrt(S); hence HOPR is about # # HOPR ~ 2^s sqrt( fs/2/B ) # # with 2^s = 32768, fs=120MHz, B=10MHz it follows # that HOPR ~ 1E5; we add some margin... field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(ai, "HL3A:SBPM:HL40:RED") { field(DESC, "RED Strip Amplitude") field(DTYP, "Raw Bpm Signal") # 'card' selects PAD number, 'signal' selects strip field(INP, "#C4 S1") field(EGU, "raw") field(SCAN, "Passive") field(FLNK, "HL3A:SBPM:HL40:BLU") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(ai, "HL3A:SBPM:HL40:BLU") { field(DESC, "BLU Strip Amplitude") field(DTYP, "Raw Bpm Signal") # 'card' selects PAD number, 'signal' selects strip field(INP, "#C4 S2") field(EGU, "raw") field(SCAN, "Passive") field(FLNK, "HL3A:SBPM:HL40:YLO") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(ai, "HL3A:SBPM:HL40:YLO") { field(DESC, "YLO Strip Amplitude") field(DTYP, "Raw Bpm Signal") # 'card' selects PAD number, 'signal' selects strip field(INP, "#C4 S3") field(EGU, "raw") field(SCAN, "Passive") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } ############################################## # Slowly-scanned diagnostics ############################################## # record(waveform, "HL3A:SBPM:HL40:REDW") { field(DESC, "Raw CAL RED Data") field(DTYP, "WavBuf") # 'signal' number selects 'beam', 'calX', 'calY' field(INP, "#C4 S1") field(NELM, "512") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32768") field(LOPR, "-32767") field(SCAN, "1 second") } record(waveform, "HL3A:SBPM:HL40:GRNW") { field(DESC, "Raw CAL GRN Data") field(DTYP, "WavBuf") # 'signal' number selects 'beam', 'calX', 'calY' field(INP, "#C4 S2") field(NELM, "512") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32768") field(LOPR, "-32767") field(SCAN, "1 second") } record(waveform, "HL3A:SBPM:HL40:RAWDBG") { field(DESC, "Raw BEAM Dbg") field(DTYP, "WavBuf") # 'signal' number selects 'beam', 'calX', 'calY' # do not 'wbscan' for now since e.g., an underrange # condition on the real signal can happen. field(INP, "#C4 S7") field(NELM, "512") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32768") field(LOPR, "-32767") field(SCAN, "Passive") } record(waveform, "HL3A:SBPM:HL40:REDDBG") { field(DESC, "Raw CAL RED Dbg") field(DTYP, "WavBuf") # 'signal' number selects 'beam', 'calX', 'calY' field(INP, "#C4 S8 @wbscan") field(NELM, "512") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32768") field(LOPR, "-32767") field(SCAN, "Passive") } record(waveform, "HL3A:SBPM:HL40:GRNDBG") { field(DESC, "Raw CAL GRN Dbg") field(DTYP, "WavBuf") # 'signal' number selects 'beam', 'calX', 'calY' field(INP, "#C4 S9 @wbscan") field(NELM, "512") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32768") field(LOPR, "-32767") field(SCAN, "Passive") } record(ai, "HL3A:SBPM:HL40:GRUV") { field(DESC, "CAL Gain GRN/RED") field(DTYP, "Raw Stripl Calp") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C4 S0") field(SCAN, "10 second") field(PREC, "4") field(LOPR, "0.5") field(HOPR, "1.5") } record(ai, "HL3A:SBPM:HL40:GRU") { field(DESC, "CAL Gain GRN/BLU") field(DTYP, "Raw Stripl Calp") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C4 S1") field(SCAN, "10 second") field(PREC, "4") field(LOPR, "0.5") field(HOPR, "1.5") info(autosaveFields, "ASLO") } record(ai, "HL3A:SBPM:HL40:GRV") { field(DESC, "CAL Gain RED/YLO") field(DTYP, "Raw Stripl Calp") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C4 S2") field(SCAN, "10 second") field(PREC, "4") field(LOPR, "0.5") field(HOPR, "1.5") info(autosaveFields, "ASLO") } record(ai, "HL3A:SBPM:HL40:TGRN") { field(DESC, "Green arrival time") field(DTYP, "Raw Bpm Signal") field(EGU, "ADC Clocks") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C4 S4") field(SCAN, "10 second") field(PREC, "1") field(LOPR, "0") field(HOPR, "128") field(LOLO, "5") field(LOW, "8") field(HIGH, "60") field(HIHI, "70") field(LLSV, "MAJOR") field(LSV, "MINOR") field(HSV, "MINOR") field(HHSV, "MAJOR") } record(ai, "HL3A:SBPM:HL40:TRED") { field(DESC, "Red arrival time") field(DTYP, "Raw Bpm Signal") field(EGU, "ADC Clocks") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C4 S5") field(SCAN, "10 second") field(PREC, "1") field(LOPR, "0") field(HOPR, "128") field(LOLO, "5") field(LOW, "8") field(HIGH, "60") field(HIHI, "70") field(LLSV, "MAJOR") field(LSV, "MINOR") field(HSV, "MINOR") field(HHSV, "MAJOR") } record(ai, "HL3A:SBPM:HL40:TBLU") { field(DESC, "Blue arrival time") field(DTYP, "Raw Bpm Signal") field(EGU, "ADC Clocks") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C4 S6") field(SCAN, "10 second") field(PREC, "1") field(LOPR, "0") field(HOPR, "128") field(LOLO, "5") field(LOW, "8") field(HIGH, "60") field(HIHI, "70") field(LLSV, "MAJOR") field(LSV, "MINOR") field(HSV, "MINOR") field(HHSV, "MAJOR") } record(ai, "HL3A:SBPM:HL40:TYLO") { field(DESC, "Yellow arrival time") field(DTYP, "Raw Bpm Signal") field(EGU, "ADC Clocks") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C4 S7") field(SCAN, "10 second") field(PREC, "1") field(LOPR, "0") field(HOPR, "128") field(LOLO, "5") field(LOW, "8") field(HIGH, "60") field(HIHI, "70") field(LLSV, "MAJOR") field(LSV, "MINOR") field(HSV, "MINOR") field(HHSV, "MAJOR") } record(ao, "HL3A:SBPM:HL40:PINC_ADJ") { field(DESC, "Adjust Pinc. Corr.") field(DTYP, "Soft Channel") field(OUT, "HL3A:SBPM:HL40:CALC.K PP MS") field(VAL, "0") field(DRVL, "0") field(DRVH, "2") field(PINI, "YES") info(autosaveFields, "VAL") } # QSCL setting: # # Q: charge # Z: impedance # F: form factor: phi/(2 pi) sin(2 pi f l/c) # # Signal = Q Z F G h(t) = A h(t) [A] = Vs # # inf inf # Energy = A^2 / h^2(t) dt = A^2 / |H(w)|^2 dw/2/pi = A^2 B # 0 0 # # Measured energy = Sum{ (Vp/32768 * xi)^2 } / fs = S / fs ~ Energy # # -> A^2 B = S/fs # # With T = sqrt( Sum{ xi^2 } ) # # A = sqrt(S)/sqrt(B*fs) = T/sqrt(B*fs) Vp/32768 # # T/32768 Vp # Q = A/F/G/Z = ----------------- # F G Z sqrt(B*fs) # # Vp = { 1.5Vpp/2 (PGA=1) or 2.25Vpp/2 (PGA=0) } / 2 (transformer) # # I believe PGA is off (-> Vp ~ .56V) # # Z = 50 # # G: (calibration uses GRN/BLU -> signal should have the # level of the grn/red channels with the additional switch) # # Block diagram / parts / gain: # # [filt] [Att1] [Amp1] [Att2] [BPF] [Amp2] [pad] [Amp3] [switch] # f-17520 hmc540lp3 SBF-5089 hmc540lp3 MBP-140-6-4 SBF-4089 PAT-0 SBF-4089 HMC-197 # # -2dB* -1dB 20dB -1dB -4.5 14.8dB 0dB 14.8dB -0.4dB # # *: 1st filter ATT is a wild guess. # BPF loss (RLC Catalog, pp.55): (L (nsect+.5) / (% of 3dB BW) + .2) dB # with L ~6.2 10MHz/fc=140Mhz filter-> 4.5 # # -> Gtot ~ 40.7dB # # subtract cable loss (2dB); Gtot = 86 # # T/32768 Vp .56V/32768 # Q = A/F/G/Z = ----------------- = T/F ------------------------ # F G Z sqrt(B*fs) 86*50*sqrt(10*140)Mhz # # = T/F = 1.06E-7/F nC # # F for a 7% coverage, 4" BPM at 140MHz .07 sin(2*pi*140e6 4*.0254/3e8) # = .021 # # => 1.06E-7/.021 nC = 5E-6 nC # # (Faraday cup measurement -> (3600/44)^-1 1e-4 -> 1.22E-6 # record(ao, "HL3A:SBPM:HL40:QSCL") { field(DESC, "TMIT/Charge Scale") field(DTYP, "Soft Channel") field(OUT, "HL3A:SBPM:HL40:QSCA.A PP MS") # 5.0E-6 / 1.6E-10 [nC/e-] field(VAL, "31250") field(EGU, "Nel") field(PREC, "3") field(PINI, "YES") info(autosaveFields, "VAL") } # Adjust TMIT scale for AFE attenuation record(calcout, "HL3A:SBPM:HL40:QSCA") { field(DESC, "TMIT ATT Adj. Scale") field(INPB, "HL3A:SBPM:HL40:ATT1 CP") field(INPC, "HL3A:SBPM:HL40:ATT2 CP") field(CALC, "A*10^((B+C+D)/20)") # use CA link to deposit into TMIT.ASLO so # that TMIT is not forced into linkset # of this record field(OUT, "HL3A:SBPM:HL40:TMIT.ASLO CA") field(EGU, "Nel") field(PREC, "3") info(autosaveFields, "D") } record(ao, "HL3A:SBPM:HL40:ATT1SIMP") { field(DESC, "ATT1 Propagator") field(DTYP, "Soft Channel") field(DOL, "HL3A:SBPM:HL40:ATT1 CP") field(OMSL, "closed_loop") field(OUT, "HL3A:SBPM:HL40:ASIM.A PP") field(IVOA, "Set output to IVOV") field(IVOV, "0") field(EGU, "dB") } record(ao, "HL3A:SBPM:HL40:ATT2SIMP") { field(DESC, "ATT2 Propagator") field(DTYP, "Soft Channel") field(DOL, "HL3A:SBPM:HL40:ATT2 CP") field(OMSL, "closed_loop") field(OUT, "HL3A:SBPM:HL40:ASIM.C PP") field(IVOA, "Set output to IVOV") field(IVOV, "0") field(EGU, "dB") } # Attenuate charge either by # real attenuator settings or # by fake ones. # If B, C >= 0 then their # values will be used instead # of ATT1, ATT2 record(calcout, "HL3A:SBPM:HL40:ASIM") { field(DESC, "Q Simul Attenuator") field(DTYP, "Soft Channel") field(OUT, "HL3A:SBPM:HL40:QSIM.ESLO PP") # ATT1SIM puts value into A # set to -1 to use real attenuator settings # and >=0 to use B instead field(B, "-1") # ATT2SIM puts value into C # set to -1 to use real attenuator settings # and >=0 to use D instead field(D, "-1") field(CALC, "10^(((B>=0?B:A)+(D>=0?D:C))/20)") field(PINI, "YES") } record(ao, "HL3A:SBPM:HL40:WSIM") { field(DESC, "BPM W Simul.") field(DTYP, "Soft Channel") field(OUT, "HL3A:SBPM:HL40:SIM.G PP") field(VAL, "0.07") field(EGU, "%") field(PINI, "YES") field(PREC, "3") field(LOPR, "0") field(HOPR, "0.25") } record(sel, "HL3A:SBPM:HL40:STA") { field(DESC, "Status Summary") field(SELM, "High Signal") field(INPA, "HL3A:SBPM:HL40:RSTA.SEVR MS NPP") field(INPB, "HL3A:SBPM:HL40:TMIT.SEVR MS NPP") field(INPC, "HL3A:SBPM:HL40:Y.SEVR MS NPP") field(INPD, "HL3A:SBPM:HL40:X.SEVR MS NPP") field(INPE, "HL3A:SBPM:HL40:TGRN.SEVR MS NPP") field(INPF, "HL3A:SBPM:HL40:TRED.SEVR MS NPP") field(INPG, "HL3A:SBPM:HL40:TBLU.SEVR MS NPP") field(INPH, "HL3A:SBPM:HL40:TYLO.SEVR MS NPP") field(INPI, "HL3A:SBPM:HL40:GRU.SEVR MS NPP") field(INPJ, "HL3A:SBPM:HL40:GRV.SEVR MS NPP") field(SCAN, "1 second") } # This record really belongs on the # PAD IOC. We keep them here however # so we can save/restore. It is more # confusing but shouldn't matter from # an efficiency standpoint (they are # rarely changed). record(longout, "HL3A:SBPM:HL40:ATTO") { field(DESC, "AFE Tot. Att. Offset") # fetched via inlink #field(OUT, "HL3A:SBPM:HL40:ATTC.B PP") field(DRVL, "-10") field(DRVH, "30") field(LOPR, "-10") field(HOPR, "30") field(EGU, "dB") field(VAL, "0") field(PINI, "YES") info(autosaveFields, "VAL DRVH HOPR DRVL LOPR") } # This record really belongs on the # PAD IOC. We keep them here however # so we can save/restore. It is more # confusing but shouldn't matter from # an efficiency standpoint (they are # rarely changed). record(longout, "HL3A:SBPM:HL40:CLAO") { field(DESC, "AFE Cal. Att. Offset") # fetched via inlink #field(OUT, "HL3A:SBPM:HL40:ATTC.C PP") field(DRVL, "-20") field(DRVH, "20") field(LOPR, "-20") field(HOPR, "20") field(EGU, "dB") field(VAL, "40") field(PINI, "YES") info(autosaveFields, "VAL DRVH HOPR DRVL LOPR") } record(calc, "HL3A:SBPM:HL40:STA_ALH") { field(DESC, "Status Summary") field(SCAN, "1 second") field(CALC, "0") field(INPA, "HL3A:SBPM:HL40:RSTA_ALH.SEVR MS NPP") field(INPB, "HL3A:SBPM:HL40:GRU.SEVR MS NPP") field(INPC, "HL3A:SBPM:HL40:GRV.SEVR MS NPP") field(INPD, "HL3A:SBPM:HL40:CHK.SEVR MS NPP") field(INPE, "") field(INPF, "HL3A:SBPM:HL40:AFE_COMM.SEVR MS NPP") } # snapshot PV for the bpm values display record(ai, "HL3A:SBPM:HL40:GRN_SLOW") { field(DESC, "GRN snapshot for display") field(INP, "HL3A:SBPM:HL40:GRN NPP MS") field(EGU, "raw") field(SCAN, "1 second") field(FLNK, "HL3A:SBPM:HL40:RED_SLOW") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(ai, "HL3A:SBPM:HL40:RED_SLOW") { field(DESC, "RED snapshot for display") # 'card' selects PAD number, 'signal' selects strip field(INP, "HL3A:SBPM:HL40:RED NPP MS") field(EGU, "raw") field(SCAN, "Passive") field(FLNK, "HL3A:SBPM:HL40:BLU_SLOW") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(ai, "HL3A:SBPM:HL40:BLU_SLOW") { field(DESC, "BLU snapshot for display") # 'card' selects PAD number, 'signal' selects strip field(INP, "HL3A:SBPM:HL40:BLU NPP MS") field(EGU, "raw") field(SCAN, "Passive") field(FLNK, "HL3A:SBPM:HL40:YLO_SLOW") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(ai, "HL3A:SBPM:HL40:YLO_SLOW") { field(DESC, "YLO snapshot for display") field(INP, "HL3A:SBPM:HL40:YLO NPP MS") field(EGU, "raw") field(SCAN, "Passive") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(sub, "HL3A:SBPM:HL40:CALC") { field(SNAM, "drvBpmBvectSetupSub") # E: phi F: psi # BPM channel number in L field(INPL, "4") field(SCAN, "Passive") } record(bo, "HL3A:SBPM:HL40:PINC_ENA") { field(DESC, "Simple Pincushion Alg") field(DTYP, "BusAddress") field(OUT, "#C0S2@drvBpmStriplPincEna,m32") field(MASK, "16") field(ZNAM, "DISABLED") field(ONAM, "ENABLED") field(VAL, "0") field(PINI, "YES") info(autosaveFields, "VAL") } record(ao, "HL3A:SBPM:HL40:UDR_THRES") { field(DESC, "Detection Underrange Threshold") field(DTYP, "Bpm Parameters") field(OUT, "#C4S0") field(EGU, "ADC Ticks") field(DOL, "45.26") field(PINI, "YES") field(DRVL, "0") field(DRVH, "32767") info(autosaveFields, "VAL") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBDEND # per BPM database for stripline BPMs ###################################### # HEAD of main processing chain ###################################### record(ai, "HL3A:SBPM:HL40:X") { field(DESC, "X Position") field(EGU, "mm") field(DTYP, "Raw Bpm Signal") field(INP, "#C4 S11") field(SCAN, "I/O Intr") # The priority determines what scan list we are being # put on (see drvPadUdpComm.c) field(PRIO, "HIGH") field(FLNK, "HL3A:SBPM:HL40:Y") field(PREC, "4") field(LOPR, "-12") field(HOPR, "+12") field(ASG, "") field(TSE, "-2") info(autosaveFields, "ASLO LOLO LOW HIGH HIHI HHSV LLSV") } record(ai, "HL3A:SBPM:HL40:Y") { field(DESC, "Y Position") field(EGU, "mm") field(DTYP, "Raw Bpm Signal") field(INP, "#C4 S12") field(FLNK, "HL3A:SBPM:HL40:TMIT") field(PREC, "4") field(LOPR, "-12") field(HOPR, "+12") field(ASG, "") field(TSE, "-2") info(autosaveFields, "ASLO LOLO LOW HIGH HIHI HHSV LLSV") } record(ai, "HL3A:SBPM:HL40:TMIT") { field(DESC, "Charge Estimate") field(DTYP, "Raw Bpm Signal") field(INP, "#C4 S13") field(EGU, "Nel") field(PREC, "3") field(LOPR, "0") field(HOPR, "1E11") # FLINK into BSA field(FLNK, "HL3A:SBPM:HL40:EFX.PROC") field(ASG, "") field(TSE, "-2") info(autosaveFields, "LOLO LOW HIGH HIHI HHSV LLSV ") } ###################################### # HEAD of diagnostics processing chain ###################################### # leave RWAV in it's own lockset; don't FLNK # to 'U' & friends record(waveform, "HL3A:SBPM:HL40:RWAV") { field(DESC, "Raw BPM Data") field(DTYP, "WavBuf") # 'signal' number selects 'beam', 'calX', 'calY' field(INP, "#C4 S0") field(SCAN, "I/O Intr") # use LOW or HIGH to end up on the 'diagnostic' # scan list (see drvPadUdpComm.c) field(PRIO, "LOW") field(NELM, "512") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32768") field(LOPR, "-32767") } record(ai, "HL3A:SBPM:HL40:U") { field(DESC, "Raw U Position") field(DTYP, "Raw Bpm Signal") field(INP, "#C4 S8") field(SCAN, "I/O Intr") # use LOW or HIGH to end up on the 'diagnostic' # scan list (see drvPadUdpComm.c) field(PRIO, "LOW") field(PREC, "5") field(EGU, "mm") field(LOPR, "-0.7") field(HOPR, "+0.7") field(FLNK, "HL3A:SBPM:HL40:V") } record(ai, "HL3A:SBPM:HL40:V") { field(DESC, "Raw V Position") field(DTYP, "Raw Bpm Signal") field(INP, "#C4 S9") field(SCAN, "Passive") field(PREC, "5") field(EGU, "mm") field(LOPR, "-0.7") field(HOPR, "+0.7") field(FLNK, "HL3A:SBPM:HL40:PINC") } record(ai, "HL3A:SBPM:HL40:PINC") { field(DESC, "Pin Cushion Corr.") field(DTYP, "Raw Bpm Signal") field(INP, "#C4 S10") field(SCAN, "Passive") } record(longin, "HL3A:SBPM:HL40:RSTA") { field(DESC, "Status of Raw Processor") field(DTYP, "Bpm Raw Status") field(INP, "#C4S0") field(SCAN, "1 second") field(LOLO, "-1") field(HIHI, "+1") field(HHSV, "INVALID") field(LLSV, "INVALID") field(FLNK, "HL3A:SBPM:HL40:RSTA_ALH") } record(calc, "HL3A:SBPM:HL40:RSTA_ALH") { field(CALC, "A & B") field(INPA, "HL3A:SBPM:HL40:RSTA") field(INPB, "0x30F") field(HIHI, "1") field(LOLO, "-1") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(SCAN, "Passive") } ###################################### # Input/Parameteres ###################################### record(ao, "HL3A:SBPM:HL40:PHI") { field(DESC, "Rot Angle") field(DTYP, "Soft Channel") field(VAL, "0") field(EGU, "deg") field(PREC, "1") field(LOPR, "-180") field(HOPR, "+180") field(FLNK, "HL3A:SBPM:HL40:PHI_SEQ") } record(ao, "HL3A:SBPM:HL40:PSI") { field(DESC, "Axis Sep. Angle") field(DTYP, "Soft Channel") field(VAL, "90") field(EGU, "deg") field(PREC, "1") field(LOPR, "0") field(HOPR, "+180") field(FLNK, "HL3A:SBPM:HL40:PSI_SEQ") } #record(dfanout, "HL3A:SBPM:HL40:PCMM") { # field(DESC, "BPM Scale") # field(OUTA, "HL3A:SBPM:HL40:USCL PP MS") # field(OUTB, "HL3A:SBPM:HL40:VSCL PP MS") # field(VAL, "12") # field(EGU, "mm") # field(PREC, "4") # field(LOPR, "5") # field(HOPR, "15") # field(PINI, "YES") #} record(ao, "HL3A:SBPM:HL40:UOFF") { field(DESC, "BPM U Offset") field(DTYP, "Soft Channel") field(VAL, "0") field(EGU, "mm") field(PREC, "4") field(LOPR, "-5") field(HOPR, "+5") field(FLNK, "HL3A:SBPM:HL40:UOFF_SEQ") } record(ao, "HL3A:SBPM:HL40:VOFF") { field(DESC, "BPM V Offset") field(DTYP, "Soft Channel") field(VAL, "0") field(EGU, "mm") field(PREC, "4") field(LOPR, "-5") field(HOPR, "+5") field(FLNK, "HL3A:SBPM:HL40:VOFF_SEQ") } record(ao, "HL3A:SBPM:HL40:USCL") { field(DESC, "BPM U Scale") field(DTYP, "Soft Channel") field(VAL, "1") field(EGU, "mm") field(PREC, "4") field(FLNK, "HL3A:SBPM:HL40:USCL_SEQ") } record(ao, "HL3A:SBPM:HL40:VSCL") { field(DESC, "BPM V Scale") field(DTYP, "Soft Channel") field(VAL, "1") field(EGU, "mm") field(PREC, "4") field(FLNK, "HL3A:SBPM:HL40:VSCL_SEQ") } record(mbbo, "HL3A:SBPM:HL40:ACCESS") { field(DESC, "BPM On Line") field(DTYP, "StreamSwitch") field(OUT, "#C4 S0") field(ZRVL, "1") field(ZRST, "Running") field(ZRSV, "NO_ALARM") field(ONVL, "1") field(ONST, "Maintenance") field(ONSV, "MINOR") field(TWVL, "1") field(TWST, "Test") field(TWSV, "MINOR") field(THVL, "0") field(THST, "OFFLINE") field(THSV, "MAJOR") # set both, rval and val to get it right # regardless of whether devsup does conversion # or not. field(RVAL, "0") field(VAL, "0") field(PINI, "YES") field(FLNK, "HL3A:SBPM:HL40:SIMOFF") info(autosaveFields, "RVAL") } # # 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, "HL3A:SBPM:HL40:FBCK") { field(DESC, "Feedback State") field(PINI, "YES") field(OMSL, "supervisory") field(VAL, "0") field(ZRVL, "0") field(ONVL, "1") field(TWVL, "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") info(autosaveFields, "VAL") } # Convenience record holding the MAD name record(stringin, "HL3A:SBPM:HL40:MADN") { field(DESC, "MAD Name") field(VAL, "SBPMHL40") field(PINI, "YES") } record(stringin, "SBPMHL40:NAME") { field(DESC, "BPM Name") field(VAL, "HL3A:SBPM:HL40") field(PINI, "YES") } record(ai, "HL3A:SBPM:HL40:X_SLOW") { #alias("HL3A:SBPM:HL40:X1H") field(DESC, "X snapshot for display") field(EGU, "mm") field(INP, "HL3A:SBPM:HL40:X MS") field(FLNK, "HL3A:SBPM:HL40:Y_SLOW") field(PREC, "4") field(SCAN, "1 second") field(LOPR, "-12") field(HOPR, "+12") } record(ai, "HL3A:SBPM:HL40:Y_SLOW") { #alias("HL3A:SBPM:HL40:Y1H") field(DESC, "Y snapshot for display") field(EGU, "mm") field(INP, "HL3A:SBPM:HL40:Y NPP MS") field(FLNK, "HL3A:SBPM:HL40:TMIT_SLOW") field(PREC, "4") field(LOPR, "-12") field(HOPR, "+12") } record(ai, "HL3A:SBPM:HL40:TMIT_SLOW") { #alias("HL3A:SBPM:HL40:TMIT1H") field(DESC, "TMIT snapshot for display") field(INP, "HL3A:SBPM:HL40:TMIT NPP MS") field(EGU, "Nel") field(PREC, "3") field(LOPR, "0") field(HOPR, "1E11") } ###################################### # Simulation Parameters + Control ###################################### # switch off simulation when going off-line record(calcout, "HL3A:SBPM:HL40:SIMOFF") { field(DESC, "Sim Off Propagator") field(INPA, "HL3A:SBPM:HL40:ACCESS.RVAL") field(CALC, "A") field(OCAL, "0") field(OOPT, "When Zero") field(DOPT, "Use OCAL") field(OUT, "HL3A:SBPM:HL40:SIMC PP") } record(calcout, "HL3A:SBPM:HL40:SIM") { field(DESC, "BPM Pos. Simulation") field(DTYP, "Strip Signal Simulator") field(OUT, "4") #CALC & VAL unused; the real calculation is done # in device support. The reason this is a # calcout rather than sub is that we want # to use the OUT link... field(CALC, "A") field(INPA, "HL3A:SBPM:HL40:USCL") field(INPL, "0") } # Switch simulation record HL3A:SBPM:HL40:SIMCSEQ moved to # bpmCavity.db.part and bpmStripl.db.part record(mbbo, "HL3A:SBPM:HL40:SIMC") { field(DESC, "Stripl Sim Ctl") field(DTYP, "Raw Soft Channel") field(OUT, "HL3A:SBPM:HL40:SIMCSEQ.SELN PP") field(ZRST, "OFF") field(ZRVL, "0x0f") field(ONST, "ON") field(ONVL, "0x1c0") field(TWST, "SOFT") field(TWVL, "0x030") field(MASK, "-1") field(NOBT, "16") field(VAL, "0") field(RVAL, "0x0f") field(PINI, "YES") } record(ao, "HL3A:SBPM:HL40:XSIM") { field(DESC, "BPM X Pos. Simul.") field(DTYP, "Soft Channel") field(OUT, "HL3A:SBPM:HL40:SIM.B PP") field(VAL, "0.5") field(EGU, "mm") field(PINI, "YES") field(PREC, "4") field(LOPR, "-12") field(HOPR, "+12") } record(ao, "HL3A:SBPM:HL40:YSIM") { field(DESC, "BPM Y Pos. Simul.") field(DTYP, "Soft Channel") field(OUT, "HL3A:SBPM:HL40:SIM.C PP") field(VAL, "0.") field(EGU, "mm") field(PINI, "YES") field(PREC, "4") field(LOPR, "-12") field(HOPR, "+12") } record(ao, "HL3A:SBPM:HL40:QSIM") { field(DESC, "BPM Q Simul.") field(DTYP, "Raw Soft Channel") field(OUT, "HL3A:SBPM:HL40:SIM.D PP") field(EGU, "Nel") field(ASLO, "6000") #ESLO is used to add attenuation field(LINR, "LINEAR") field(VAL, "1E9") field(PINI, "YES") field(PREC, "4") field(LOPR, "0") field(HOPR, "1E11") } record(ao, "HL3A:SBPM:HL40:ROTS") { field(DESC, "BPM Rot. Simul.") field(DTYP, "Soft Channel") field(OUT, "HL3A:SBPM:HL40:SIM.E PP") field(VAL, "0.") field(EGU, "deg") field(PINI, "YES") field(PREC, "1") field(LOPR, "-180") } record(ao, "HL3A:SBPM:HL40:PSIS") { field(DESC, "BPM Angle. Simul.") field(DTYP, "Soft Channel") field(OUT, "HL3A:SBPM:HL40:SIM.F PP") field(VAL, "90") field(EGU, "deg") field(PINI, "YES") field(PREC, "1") field(LOPR, "0") } record(aao, "HL3A:SBPM:HL40:DIGISIMW") { field(DESC, "VME Digi Sim. Waveform") field(DTYP, "VmeDigi Sim Wav") field(OUT, "#C4 S0") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32678") field(LOPR, "-32768") # 16384 samples/channel * 4 channels field(NELM, "65536") field(PINI, "NO") } #Used by model/database folks to verify BPM record(ao, "HL3A:SBPM:HL40:Z") { field(DESC, "Z Position") field(PINI, "YES") info(autosaveFields, "VAL") } # MPS interface record(bo, "HL3A:SBPM:HL40:MPSBYP") { field(DESC, "MPS Bypass") field(DTYP, "BusAddress") field(OUT, "#C0S2@bpmMPS+0,m32") field(MASK, "16") field(ZNAM, "BYPASSED") field(ONAM, "NOT_BYPASSED") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(VAL, "0") field(PINI, "YES") field(ASG, "") info(autosaveFields, "VAL") } record(bo, "HL3A:SBPM:HL40:MPSLTBYP") { field(DESC, "MPS Bypass") field(DTYP, "BusAddress") field(OUT, "#C1S2@bpmMPS+0,m32") field(MASK, "16") field(ZNAM, "BYPASSED") field(ONAM, "NOT_BYPASSED") field(ZSV, "NO_ALARM") field(OSV, "NO_ALARM") field(VAL, "0") field(PINI, "YES") field(ASG, "") info(autosaveFields, "VAL") } record(calc, "HL3A:SBPM:HL40:MPSIGNRCALC") { field(DESC, "MPS ignore if TMIT too low") field(CALC, "A $[parm]_SEQ # # Different values of the parameter # $[parm0]..$[parm9] are stored in # $[parm]_SEL.A .. $[parm]_SEL.J # # The actual value of the parameter is # selected based on the value of a controlling # PV $[ctrl] using a 'mapping' CALC expression # $[mapc] to convert the $[ctrl] value into # the integer range 1..10. # # The selected value of $[parm] is written # to output link $[outl] # # A) When the user writes $[parm] then # its value is deposited in the currently # selected field of $[parm]_SEL and # propagated to $[outl] # # B) When the user writes any of $[parm]_SEL.A..J # then the value is stored there. If she # writes to the currently 'active' field\ # (as selected by $[ctrl]) then # the $[parm] PV itself is updated and the # value is also propagated to $[outl] # # C) If the user changes $[ctrl] then the # corresponding value $[parm]_SEL.A..J is # propagated to $[outl] and $[parm]. # # D) At initialization, the value corresponding # to the initial setting of $[ctrl] is written # to $[outl] and $[parm] # # MACROS: # # $[parm] PV holding the parameter # $[ctrl] PV that controls the selection of # the currently active setting of # $[parm] # $[outl] PV where the currently selected # value of $[parm] shall be written-to # (if applicable) # $[prec] Precision of the $[parm]_SEL variable # (should be set to same value as $[parm].PREC) # # $[parm0]..$[parm9] initial values of $[parm] # # $[mapc] CALC expression to convert the value # of the controlling PV which is available # as 'A' to the range 1..10 (or less if # less selections are used). # E.g., to convert the value of a bo (0/1) # you would set mapc to 'A+1' (0..1 -> 1..2) # # NOTE: This sb snippet is loaded/expanded # for every parameter under control # of $[ctrl]. ALSO, the companion # snippet parmCtl.db must be loaded/expanded # but only once per controlling PV. # # This record, when scanned (as a result # of $[parm] being written and processing # its FLNK to this record] fetches $[parm] # and deposits the value into the currently # selected field of the SEL record. # # NOTE: unfortunately, the selection # mechanism of the SEQ and SEL # records differs: SEQ is 1-based, # SEL is 0-based -- now that makes # sense, doesn't it? # record(seq, "HL3A:SBPM:HL40:UOFF_SEQ") { field(DESC, "Propagate Parm -> SEL") field(DOL1, "HL3A:SBPM:HL40:UOFF") field(DOL2, "HL3A:SBPM:HL40:UOFF") field(DOL3, "HL3A:SBPM:HL40:UOFF") field(DOL4, "HL3A:SBPM:HL40:UOFF") field(DOL5, "HL3A:SBPM:HL40:UOFF") field(DOL6, "HL3A:SBPM:HL40:UOFF") field(DOL7, "HL3A:SBPM:HL40:UOFF") field(DOL8, "HL3A:SBPM:HL40:UOFF") field(DOL9, "HL3A:SBPM:HL40:UOFF") field(DOLA, "HL3A:SBPM:HL40:UOFF") field(LNK1, "HL3A:SBPM:HL40:UOFF_SEL.A PP") field(LNK2, "HL3A:SBPM:HL40:UOFF_SEL.B PP") field(LNK3, "HL3A:SBPM:HL40:UOFF_SEL.C PP") field(LNK4, "HL3A:SBPM:HL40:UOFF_SEL.D PP") field(LNK5, "HL3A:SBPM:HL40:UOFF_SEL.E PP") field(LNK6, "HL3A:SBPM:HL40:UOFF_SEL.F PP") field(LNK7, "HL3A:SBPM:HL40:UOFF_SEL.G PP") field(LNK8, "HL3A:SBPM:HL40:UOFF_SEL.H PP") field(LNK9, "HL3A:SBPM:HL40:UOFF_SEL.I PP") field(LNKA, "HL3A:SBPM:HL40:UOFF_SEL.J PP") field(SELM, "Specified") field(SELL, "HL3A:SBPM:HL40:UOFF_CTRL NPP NMS") } # The $[parm]_SEL record holds all possible # values of $[parm] in the 'A..J' fields. # # When processed it updates it's own VAL # to the currently selected input. Input # 'L' serves as the (1-based) selector, # i.e., L==1 selects 'A'->'VAL'. # # When the selected value changes (as a # result of SEQ depositing a new value OR # $[ctrl] changing and updating L) then # the propagator record attached to the # FLNK is processed. # record(sub, "HL3A:SBPM:HL40:UOFF_SEL") { # field(INAM, "parmSelSubInit") field(SNAM, "parmSelSubProc") field(A, "0") field(B, "0") field(C, "") field(D, "") field(E, "") field(F, "") field(G, "") field(H, "") field(I, "") field(J, "") field(PREC, "4") field(FLNK, "HL3A:SBPM:HL40:UOFF_PROP") info(autosaveFields, "A B C D E F G H I J") } # # Finally the dfanout record # fetches the currently selected # value from SEL and propagates it # to $[outl]. It also updates # $[parm] itself so that $[parm] # always reflects the currently # selected value. # record(dfanout, "HL3A:SBPM:HL40:UOFF_PROP") { field(OMSL, "closed_loop") field(DOL, "HL3A:SBPM:HL40:UOFF_SEL") field(OUTA, "HL3A:SBPM:HL40:U.AOFF CA") field(OUTB, "HL3A:SBPM:HL40:UOFF PP") } # Drive the SEL record when the 'ctrl' PV changes # Use a CA link to monitor such changes record(calcout, "HL3A:SBPM:HL40:UOFF_CTRL") { field(INPA, "HL3A:SBPM:HL40:PARMSEL CP") field(CALC, "A+1") field(DOPT, "Use CALC") field(OOPT, "On Change") field(OUT, "HL3A:SBPM:HL40:UOFF_SEL.L PP") } # Maintain multiple (up to 10) values of # a parameter: # # Record holding the parameter $[parm] # must FLNK -> $[parm]_SEQ # # Different values of the parameter # $[parm0]..$[parm9] are stored in # $[parm]_SEL.A .. $[parm]_SEL.J # # The actual value of the parameter is # selected based on the value of a controlling # PV $[ctrl] using a 'mapping' CALC expression # $[mapc] to convert the $[ctrl] value into # the integer range 1..10. # # The selected value of $[parm] is written # to output link $[outl] # # A) When the user writes $[parm] then # its value is deposited in the currently # selected field of $[parm]_SEL and # propagated to $[outl] # # B) When the user writes any of $[parm]_SEL.A..J # then the value is stored there. If she # writes to the currently 'active' field\ # (as selected by $[ctrl]) then # the $[parm] PV itself is updated and the # value is also propagated to $[outl] # # C) If the user changes $[ctrl] then the # corresponding value $[parm]_SEL.A..J is # propagated to $[outl] and $[parm]. # # D) At initialization, the value corresponding # to the initial setting of $[ctrl] is written # to $[outl] and $[parm] # # MACROS: # # $[parm] PV holding the parameter # $[ctrl] PV that controls the selection of # the currently active setting of # $[parm] # $[outl] PV where the currently selected # value of $[parm] shall be written-to # (if applicable) # $[prec] Precision of the $[parm]_SEL variable # (should be set to same value as $[parm].PREC) # # $[parm0]..$[parm9] initial values of $[parm] # # $[mapc] CALC expression to convert the value # of the controlling PV which is available # as 'A' to the range 1..10 (or less if # less selections are used). # E.g., to convert the value of a bo (0/1) # you would set mapc to 'A+1' (0..1 -> 1..2) # # NOTE: This sb snippet is loaded/expanded # for every parameter under control # of $[ctrl]. ALSO, the companion # snippet parmCtl.db must be loaded/expanded # but only once per controlling PV. # # This record, when scanned (as a result # of $[parm] being written and processing # its FLNK to this record] fetches $[parm] # and deposits the value into the currently # selected field of the SEL record. # # NOTE: unfortunately, the selection # mechanism of the SEQ and SEL # records differs: SEQ is 1-based, # SEL is 0-based -- now that makes # sense, doesn't it? # record(seq, "HL3A:SBPM:HL40:VOFF_SEQ") { field(DESC, "Propagate Parm -> SEL") field(DOL1, "HL3A:SBPM:HL40:VOFF") field(DOL2, "HL3A:SBPM:HL40:VOFF") field(DOL3, "HL3A:SBPM:HL40:VOFF") field(DOL4, "HL3A:SBPM:HL40:VOFF") field(DOL5, "HL3A:SBPM:HL40:VOFF") field(DOL6, "HL3A:SBPM:HL40:VOFF") field(DOL7, "HL3A:SBPM:HL40:VOFF") field(DOL8, "HL3A:SBPM:HL40:VOFF") field(DOL9, "HL3A:SBPM:HL40:VOFF") field(DOLA, "HL3A:SBPM:HL40:VOFF") field(LNK1, "HL3A:SBPM:HL40:VOFF_SEL.A PP") field(LNK2, "HL3A:SBPM:HL40:VOFF_SEL.B PP") field(LNK3, "HL3A:SBPM:HL40:VOFF_SEL.C PP") field(LNK4, "HL3A:SBPM:HL40:VOFF_SEL.D PP") field(LNK5, "HL3A:SBPM:HL40:VOFF_SEL.E PP") field(LNK6, "HL3A:SBPM:HL40:VOFF_SEL.F PP") field(LNK7, "HL3A:SBPM:HL40:VOFF_SEL.G PP") field(LNK8, "HL3A:SBPM:HL40:VOFF_SEL.H PP") field(LNK9, "HL3A:SBPM:HL40:VOFF_SEL.I PP") field(LNKA, "HL3A:SBPM:HL40:VOFF_SEL.J PP") field(SELM, "Specified") field(SELL, "HL3A:SBPM:HL40:VOFF_CTRL NPP NMS") } # The $[parm]_SEL record holds all possible # values of $[parm] in the 'A..J' fields. # # When processed it updates it's own VAL # to the currently selected input. Input # 'L' serves as the (1-based) selector, # i.e., L==1 selects 'A'->'VAL'. # # When the selected value changes (as a # result of SEQ depositing a new value OR # $[ctrl] changing and updating L) then # the propagator record attached to the # FLNK is processed. # record(sub, "HL3A:SBPM:HL40:VOFF_SEL") { # field(INAM, "parmSelSubInit") field(SNAM, "parmSelSubProc") field(A, "0") field(B, "0") field(C, "") field(D, "") field(E, "") field(F, "") field(G, "") field(H, "") field(I, "") field(J, "") field(PREC, "4") field(FLNK, "HL3A:SBPM:HL40:VOFF_PROP") info(autosaveFields, "A B C D E F G H I J") } # # Finally the dfanout record # fetches the currently selected # value from SEL and propagates it # to $[outl]. It also updates # $[parm] itself so that $[parm] # always reflects the currently # selected value. # record(dfanout, "HL3A:SBPM:HL40:VOFF_PROP") { field(OMSL, "closed_loop") field(DOL, "HL3A:SBPM:HL40:VOFF_SEL") field(OUTA, "HL3A:SBPM:HL40:V.AOFF CA") field(OUTB, "HL3A:SBPM:HL40:VOFF PP") } # Drive the SEL record when the 'ctrl' PV changes # Use a CA link to monitor such changes record(calcout, "HL3A:SBPM:HL40:VOFF_CTRL") { field(INPA, "HL3A:SBPM:HL40:PARMSEL CP") field(CALC, "A+1") field(DOPT, "Use CALC") field(OOPT, "On Change") field(OUT, "HL3A:SBPM:HL40:VOFF_SEL.L PP") } # Maintain multiple (up to 10) values of # a parameter: # # Record holding the parameter $[parm] # must FLNK -> $[parm]_SEQ # # Different values of the parameter # $[parm0]..$[parm9] are stored in # $[parm]_SEL.A .. $[parm]_SEL.J # # The actual value of the parameter is # selected based on the value of a controlling # PV $[ctrl] using a 'mapping' CALC expression # $[mapc] to convert the $[ctrl] value into # the integer range 1..10. # # The selected value of $[parm] is written # to output link $[outl] # # A) When the user writes $[parm] then # its value is deposited in the currently # selected field of $[parm]_SEL and # propagated to $[outl] # # B) When the user writes any of $[parm]_SEL.A..J # then the value is stored there. If she # writes to the currently 'active' field\ # (as selected by $[ctrl]) then # the $[parm] PV itself is updated and the # value is also propagated to $[outl] # # C) If the user changes $[ctrl] then the # corresponding value $[parm]_SEL.A..J is # propagated to $[outl] and $[parm]. # # D) At initialization, the value corresponding # to the initial setting of $[ctrl] is written # to $[outl] and $[parm] # # MACROS: # # $[parm] PV holding the parameter # $[ctrl] PV that controls the selection of # the currently active setting of # $[parm] # $[outl] PV where the currently selected # value of $[parm] shall be written-to # (if applicable) # $[prec] Precision of the $[parm]_SEL variable # (should be set to same value as $[parm].PREC) # # $[parm0]..$[parm9] initial values of $[parm] # # $[mapc] CALC expression to convert the value # of the controlling PV which is available # as 'A' to the range 1..10 (or less if # less selections are used). # E.g., to convert the value of a bo (0/1) # you would set mapc to 'A+1' (0..1 -> 1..2) # # NOTE: This sb snippet is loaded/expanded # for every parameter under control # of $[ctrl]. ALSO, the companion # snippet parmCtl.db must be loaded/expanded # but only once per controlling PV. # # This record, when scanned (as a result # of $[parm] being written and processing # its FLNK to this record] fetches $[parm] # and deposits the value into the currently # selected field of the SEL record. # # NOTE: unfortunately, the selection # mechanism of the SEQ and SEL # records differs: SEQ is 1-based, # SEL is 0-based -- now that makes # sense, doesn't it? # record(seq, "HL3A:SBPM:HL40:USCL_SEQ") { field(DESC, "Propagate Parm -> SEL") field(DOL1, "HL3A:SBPM:HL40:USCL") field(DOL2, "HL3A:SBPM:HL40:USCL") field(DOL3, "HL3A:SBPM:HL40:USCL") field(DOL4, "HL3A:SBPM:HL40:USCL") field(DOL5, "HL3A:SBPM:HL40:USCL") field(DOL6, "HL3A:SBPM:HL40:USCL") field(DOL7, "HL3A:SBPM:HL40:USCL") field(DOL8, "HL3A:SBPM:HL40:USCL") field(DOL9, "HL3A:SBPM:HL40:USCL") field(DOLA, "HL3A:SBPM:HL40:USCL") field(LNK1, "HL3A:SBPM:HL40:USCL_SEL.A PP") field(LNK2, "HL3A:SBPM:HL40:USCL_SEL.B PP") field(LNK3, "HL3A:SBPM:HL40:USCL_SEL.C PP") field(LNK4, "HL3A:SBPM:HL40:USCL_SEL.D PP") field(LNK5, "HL3A:SBPM:HL40:USCL_SEL.E PP") field(LNK6, "HL3A:SBPM:HL40:USCL_SEL.F PP") field(LNK7, "HL3A:SBPM:HL40:USCL_SEL.G PP") field(LNK8, "HL3A:SBPM:HL40:USCL_SEL.H PP") field(LNK9, "HL3A:SBPM:HL40:USCL_SEL.I PP") field(LNKA, "HL3A:SBPM:HL40:USCL_SEL.J PP") field(SELM, "Specified") field(SELL, "HL3A:SBPM:HL40:USCL_CTRL NPP NMS") } # The $[parm]_SEL record holds all possible # values of $[parm] in the 'A..J' fields. # # When processed it updates it's own VAL # to the currently selected input. Input # 'L' serves as the (1-based) selector, # i.e., L==1 selects 'A'->'VAL'. # # When the selected value changes (as a # result of SEQ depositing a new value OR # $[ctrl] changing and updating L) then # the propagator record attached to the # FLNK is processed. # record(sub, "HL3A:SBPM:HL40:USCL_SEL") { # field(INAM, "parmSelSubInit") field(SNAM, "parmSelSubProc") field(A, "1") field(B, "1") field(C, "") field(D, "") field(E, "") field(F, "") field(G, "") field(H, "") field(I, "") field(J, "") field(PREC, "4") field(FLNK, "HL3A:SBPM:HL40:USCL_PROP") info(autosaveFields, "A B C D E F G H I J") } # # Finally the dfanout record # fetches the currently selected # value from SEL and propagates it # to $[outl]. It also updates # $[parm] itself so that $[parm] # always reflects the currently # selected value. # record(dfanout, "HL3A:SBPM:HL40:USCL_PROP") { field(OMSL, "closed_loop") field(DOL, "HL3A:SBPM:HL40:USCL_SEL") field(OUTA, "HL3A:SBPM:HL40:U.ASLO CA") field(OUTB, "HL3A:SBPM:HL40:USCL PP") } # Drive the SEL record when the 'ctrl' PV changes # Use a CA link to monitor such changes record(calcout, "HL3A:SBPM:HL40:USCL_CTRL") { field(INPA, "HL3A:SBPM:HL40:PARMSEL CP") field(CALC, "A+1") field(DOPT, "Use CALC") field(OOPT, "On Change") field(OUT, "HL3A:SBPM:HL40:USCL_SEL.L PP") } # Maintain multiple (up to 10) values of # a parameter: # # Record holding the parameter $[parm] # must FLNK -> $[parm]_SEQ # # Different values of the parameter # $[parm0]..$[parm9] are stored in # $[parm]_SEL.A .. $[parm]_SEL.J # # The actual value of the parameter is # selected based on the value of a controlling # PV $[ctrl] using a 'mapping' CALC expression # $[mapc] to convert the $[ctrl] value into # the integer range 1..10. # # The selected value of $[parm] is written # to output link $[outl] # # A) When the user writes $[parm] then # its value is deposited in the currently # selected field of $[parm]_SEL and # propagated to $[outl] # # B) When the user writes any of $[parm]_SEL.A..J # then the value is stored there. If she # writes to the currently 'active' field\ # (as selected by $[ctrl]) then # the $[parm] PV itself is updated and the # value is also propagated to $[outl] # # C) If the user changes $[ctrl] then the # corresponding value $[parm]_SEL.A..J is # propagated to $[outl] and $[parm]. # # D) At initialization, the value corresponding # to the initial setting of $[ctrl] is written # to $[outl] and $[parm] # # MACROS: # # $[parm] PV holding the parameter # $[ctrl] PV that controls the selection of # the currently active setting of # $[parm] # $[outl] PV where the currently selected # value of $[parm] shall be written-to # (if applicable) # $[prec] Precision of the $[parm]_SEL variable # (should be set to same value as $[parm].PREC) # # $[parm0]..$[parm9] initial values of $[parm] # # $[mapc] CALC expression to convert the value # of the controlling PV which is available # as 'A' to the range 1..10 (or less if # less selections are used). # E.g., to convert the value of a bo (0/1) # you would set mapc to 'A+1' (0..1 -> 1..2) # # NOTE: This sb snippet is loaded/expanded # for every parameter under control # of $[ctrl]. ALSO, the companion # snippet parmCtl.db must be loaded/expanded # but only once per controlling PV. # # This record, when scanned (as a result # of $[parm] being written and processing # its FLNK to this record] fetches $[parm] # and deposits the value into the currently # selected field of the SEL record. # # NOTE: unfortunately, the selection # mechanism of the SEQ and SEL # records differs: SEQ is 1-based, # SEL is 0-based -- now that makes # sense, doesn't it? # record(seq, "HL3A:SBPM:HL40:VSCL_SEQ") { field(DESC, "Propagate Parm -> SEL") field(DOL1, "HL3A:SBPM:HL40:VSCL") field(DOL2, "HL3A:SBPM:HL40:VSCL") field(DOL3, "HL3A:SBPM:HL40:VSCL") field(DOL4, "HL3A:SBPM:HL40:VSCL") field(DOL5, "HL3A:SBPM:HL40:VSCL") field(DOL6, "HL3A:SBPM:HL40:VSCL") field(DOL7, "HL3A:SBPM:HL40:VSCL") field(DOL8, "HL3A:SBPM:HL40:VSCL") field(DOL9, "HL3A:SBPM:HL40:VSCL") field(DOLA, "HL3A:SBPM:HL40:VSCL") field(LNK1, "HL3A:SBPM:HL40:VSCL_SEL.A PP") field(LNK2, "HL3A:SBPM:HL40:VSCL_SEL.B PP") field(LNK3, "HL3A:SBPM:HL40:VSCL_SEL.C PP") field(LNK4, "HL3A:SBPM:HL40:VSCL_SEL.D PP") field(LNK5, "HL3A:SBPM:HL40:VSCL_SEL.E PP") field(LNK6, "HL3A:SBPM:HL40:VSCL_SEL.F PP") field(LNK7, "HL3A:SBPM:HL40:VSCL_SEL.G PP") field(LNK8, "HL3A:SBPM:HL40:VSCL_SEL.H PP") field(LNK9, "HL3A:SBPM:HL40:VSCL_SEL.I PP") field(LNKA, "HL3A:SBPM:HL40:VSCL_SEL.J PP") field(SELM, "Specified") field(SELL, "HL3A:SBPM:HL40:VSCL_CTRL NPP NMS") } # The $[parm]_SEL record holds all possible # values of $[parm] in the 'A..J' fields. # # When processed it updates it's own VAL # to the currently selected input. Input # 'L' serves as the (1-based) selector, # i.e., L==1 selects 'A'->'VAL'. # # When the selected value changes (as a # result of SEQ depositing a new value OR # $[ctrl] changing and updating L) then # the propagator record attached to the # FLNK is processed. # record(sub, "HL3A:SBPM:HL40:VSCL_SEL") { # field(INAM, "parmSelSubInit") field(SNAM, "parmSelSubProc") field(A, "1") field(B, "1") field(C, "") field(D, "") field(E, "") field(F, "") field(G, "") field(H, "") field(I, "") field(J, "") field(PREC, "4") field(FLNK, "HL3A:SBPM:HL40:VSCL_PROP") info(autosaveFields, "A B C D E F G H I J") } # # Finally the dfanout record # fetches the currently selected # value from SEL and propagates it # to $[outl]. It also updates # $[parm] itself so that $[parm] # always reflects the currently # selected value. # record(dfanout, "HL3A:SBPM:HL40:VSCL_PROP") { field(OMSL, "closed_loop") field(DOL, "HL3A:SBPM:HL40:VSCL_SEL") field(OUTA, "HL3A:SBPM:HL40:V.ASLO CA") field(OUTB, "HL3A:SBPM:HL40:VSCL PP") } # Drive the SEL record when the 'ctrl' PV changes # Use a CA link to monitor such changes record(calcout, "HL3A:SBPM:HL40:VSCL_CTRL") { field(INPA, "HL3A:SBPM:HL40:PARMSEL CP") field(CALC, "A+1") field(DOPT, "Use CALC") field(OOPT, "On Change") field(OUT, "HL3A:SBPM:HL40:VSCL_SEL.L PP") } # Maintain multiple (up to 10) values of # a parameter: # # Record holding the parameter $[parm] # must FLNK -> $[parm]_SEQ # # Different values of the parameter # $[parm0]..$[parm9] are stored in # $[parm]_SEL.A .. $[parm]_SEL.J # # The actual value of the parameter is # selected based on the value of a controlling # PV $[ctrl] using a 'mapping' CALC expression # $[mapc] to convert the $[ctrl] value into # the integer range 1..10. # # The selected value of $[parm] is written # to output link $[outl] # # A) When the user writes $[parm] then # its value is deposited in the currently # selected field of $[parm]_SEL and # propagated to $[outl] # # B) When the user writes any of $[parm]_SEL.A..J # then the value is stored there. If she # writes to the currently 'active' field\ # (as selected by $[ctrl]) then # the $[parm] PV itself is updated and the # value is also propagated to $[outl] # # C) If the user changes $[ctrl] then the # corresponding value $[parm]_SEL.A..J is # propagated to $[outl] and $[parm]. # # D) At initialization, the value corresponding # to the initial setting of $[ctrl] is written # to $[outl] and $[parm] # # MACROS: # # $[parm] PV holding the parameter # $[ctrl] PV that controls the selection of # the currently active setting of # $[parm] # $[outl] PV where the currently selected # value of $[parm] shall be written-to # (if applicable) # $[prec] Precision of the $[parm]_SEL variable # (should be set to same value as $[parm].PREC) # # $[parm0]..$[parm9] initial values of $[parm] # # $[mapc] CALC expression to convert the value # of the controlling PV which is available # as 'A' to the range 1..10 (or less if # less selections are used). # E.g., to convert the value of a bo (0/1) # you would set mapc to 'A+1' (0..1 -> 1..2) # # NOTE: This sb snippet is loaded/expanded # for every parameter under control # of $[ctrl]. ALSO, the companion # snippet parmCtl.db must be loaded/expanded # but only once per controlling PV. # # This record, when scanned (as a result # of $[parm] being written and processing # its FLNK to this record] fetches $[parm] # and deposits the value into the currently # selected field of the SEL record. # # NOTE: unfortunately, the selection # mechanism of the SEQ and SEL # records differs: SEQ is 1-based, # SEL is 0-based -- now that makes # sense, doesn't it? # record(seq, "HL3A:SBPM:HL40:PHI_SEQ") { field(DESC, "Propagate Parm -> SEL") field(DOL1, "HL3A:SBPM:HL40:PHI") field(DOL2, "HL3A:SBPM:HL40:PHI") field(DOL3, "HL3A:SBPM:HL40:PHI") field(DOL4, "HL3A:SBPM:HL40:PHI") field(DOL5, "HL3A:SBPM:HL40:PHI") field(DOL6, "HL3A:SBPM:HL40:PHI") field(DOL7, "HL3A:SBPM:HL40:PHI") field(DOL8, "HL3A:SBPM:HL40:PHI") field(DOL9, "HL3A:SBPM:HL40:PHI") field(DOLA, "HL3A:SBPM:HL40:PHI") field(LNK1, "HL3A:SBPM:HL40:PHI_SEL.A PP") field(LNK2, "HL3A:SBPM:HL40:PHI_SEL.B PP") field(LNK3, "HL3A:SBPM:HL40:PHI_SEL.C PP") field(LNK4, "HL3A:SBPM:HL40:PHI_SEL.D PP") field(LNK5, "HL3A:SBPM:HL40:PHI_SEL.E PP") field(LNK6, "HL3A:SBPM:HL40:PHI_SEL.F PP") field(LNK7, "HL3A:SBPM:HL40:PHI_SEL.G PP") field(LNK8, "HL3A:SBPM:HL40:PHI_SEL.H PP") field(LNK9, "HL3A:SBPM:HL40:PHI_SEL.I PP") field(LNKA, "HL3A:SBPM:HL40:PHI_SEL.J PP") field(SELM, "Specified") field(SELL, "HL3A:SBPM:HL40:PHI_CTRL NPP NMS") } # The $[parm]_SEL record holds all possible # values of $[parm] in the 'A..J' fields. # # When processed it updates it's own VAL # to the currently selected input. Input # 'L' serves as the (1-based) selector, # i.e., L==1 selects 'A'->'VAL'. # # When the selected value changes (as a # result of SEQ depositing a new value OR # $[ctrl] changing and updating L) then # the propagator record attached to the # FLNK is processed. # record(sub, "HL3A:SBPM:HL40:PHI_SEL") { # field(INAM, "parmSelSubInit") field(SNAM, "parmSelSubProc") field(A, "0") field(B, "0") field(C, "") field(D, "") field(E, "") field(F, "") field(G, "") field(H, "") field(I, "") field(J, "") field(PREC, "1") field(FLNK, "HL3A:SBPM:HL40:PHI_PROP") info(autosaveFields, "A B C D E F G H I J") } # # Finally the dfanout record # fetches the currently selected # value from SEL and propagates it # to $[outl]. It also updates # $[parm] itself so that $[parm] # always reflects the currently # selected value. # record(dfanout, "HL3A:SBPM:HL40:PHI_PROP") { field(OMSL, "closed_loop") field(DOL, "HL3A:SBPM:HL40:PHI_SEL") field(OUTA, "HL3A:SBPM:HL40:CALC.E CA") field(OUTB, "HL3A:SBPM:HL40:PHI PP") } # Drive the SEL record when the 'ctrl' PV changes # Use a CA link to monitor such changes record(calcout, "HL3A:SBPM:HL40:PHI_CTRL") { field(INPA, "HL3A:SBPM:HL40:PARMSEL CP") field(CALC, "A+1") field(DOPT, "Use CALC") field(OOPT, "On Change") field(OUT, "HL3A:SBPM:HL40:PHI_SEL.L PP") } # Maintain multiple (up to 10) values of # a parameter: # # Record holding the parameter $[parm] # must FLNK -> $[parm]_SEQ # # Different values of the parameter # $[parm0]..$[parm9] are stored in # $[parm]_SEL.A .. $[parm]_SEL.J # # The actual value of the parameter is # selected based on the value of a controlling # PV $[ctrl] using a 'mapping' CALC expression # $[mapc] to convert the $[ctrl] value into # the integer range 1..10. # # The selected value of $[parm] is written # to output link $[outl] # # A) When the user writes $[parm] then # its value is deposited in the currently # selected field of $[parm]_SEL and # propagated to $[outl] # # B) When the user writes any of $[parm]_SEL.A..J # then the value is stored there. If she # writes to the currently 'active' field\ # (as selected by $[ctrl]) then # the $[parm] PV itself is updated and the # value is also propagated to $[outl] # # C) If the user changes $[ctrl] then the # corresponding value $[parm]_SEL.A..J is # propagated to $[outl] and $[parm]. # # D) At initialization, the value corresponding # to the initial setting of $[ctrl] is written # to $[outl] and $[parm] # # MACROS: # # $[parm] PV holding the parameter # $[ctrl] PV that controls the selection of # the currently active setting of # $[parm] # $[outl] PV where the currently selected # value of $[parm] shall be written-to # (if applicable) # $[prec] Precision of the $[parm]_SEL variable # (should be set to same value as $[parm].PREC) # # $[parm0]..$[parm9] initial values of $[parm] # # $[mapc] CALC expression to convert the value # of the controlling PV which is available # as 'A' to the range 1..10 (or less if # less selections are used). # E.g., to convert the value of a bo (0/1) # you would set mapc to 'A+1' (0..1 -> 1..2) # # NOTE: This sb snippet is loaded/expanded # for every parameter under control # of $[ctrl]. ALSO, the companion # snippet parmCtl.db must be loaded/expanded # but only once per controlling PV. # # This record, when scanned (as a result # of $[parm] being written and processing # its FLNK to this record] fetches $[parm] # and deposits the value into the currently # selected field of the SEL record. # # NOTE: unfortunately, the selection # mechanism of the SEQ and SEL # records differs: SEQ is 1-based, # SEL is 0-based -- now that makes # sense, doesn't it? # record(seq, "HL3A:SBPM:HL40:PSI_SEQ") { field(DESC, "Propagate Parm -> SEL") field(DOL1, "HL3A:SBPM:HL40:PSI") field(DOL2, "HL3A:SBPM:HL40:PSI") field(DOL3, "HL3A:SBPM:HL40:PSI") field(DOL4, "HL3A:SBPM:HL40:PSI") field(DOL5, "HL3A:SBPM:HL40:PSI") field(DOL6, "HL3A:SBPM:HL40:PSI") field(DOL7, "HL3A:SBPM:HL40:PSI") field(DOL8, "HL3A:SBPM:HL40:PSI") field(DOL9, "HL3A:SBPM:HL40:PSI") field(DOLA, "HL3A:SBPM:HL40:PSI") field(LNK1, "HL3A:SBPM:HL40:PSI_SEL.A PP") field(LNK2, "HL3A:SBPM:HL40:PSI_SEL.B PP") field(LNK3, "HL3A:SBPM:HL40:PSI_SEL.C PP") field(LNK4, "HL3A:SBPM:HL40:PSI_SEL.D PP") field(LNK5, "HL3A:SBPM:HL40:PSI_SEL.E PP") field(LNK6, "HL3A:SBPM:HL40:PSI_SEL.F PP") field(LNK7, "HL3A:SBPM:HL40:PSI_SEL.G PP") field(LNK8, "HL3A:SBPM:HL40:PSI_SEL.H PP") field(LNK9, "HL3A:SBPM:HL40:PSI_SEL.I PP") field(LNKA, "HL3A:SBPM:HL40:PSI_SEL.J PP") field(SELM, "Specified") field(SELL, "HL3A:SBPM:HL40:PSI_CTRL NPP NMS") } # The $[parm]_SEL record holds all possible # values of $[parm] in the 'A..J' fields. # # When processed it updates it's own VAL # to the currently selected input. Input # 'L' serves as the (1-based) selector, # i.e., L==1 selects 'A'->'VAL'. # # When the selected value changes (as a # result of SEQ depositing a new value OR # $[ctrl] changing and updating L) then # the propagator record attached to the # FLNK is processed. # record(sub, "HL3A:SBPM:HL40:PSI_SEL") { # field(INAM, "parmSelSubInit") field(SNAM, "parmSelSubProc") field(A, "90") field(B, "90") field(C, "") field(D, "") field(E, "") field(F, "") field(G, "") field(H, "") field(I, "") field(J, "") field(PREC, "1") field(FLNK, "HL3A:SBPM:HL40:PSI_PROP") info(autosaveFields, "A B C D E F G H I J") } # # Finally the dfanout record # fetches the currently selected # value from SEL and propagates it # to $[outl]. It also updates # $[parm] itself so that $[parm] # always reflects the currently # selected value. # record(dfanout, "HL3A:SBPM:HL40:PSI_PROP") { field(OMSL, "closed_loop") field(DOL, "HL3A:SBPM:HL40:PSI_SEL") field(OUTA, "HL3A:SBPM:HL40:CALC.F CA") field(OUTB, "HL3A:SBPM:HL40:PSI PP") } # Drive the SEL record when the 'ctrl' PV changes # Use a CA link to monitor such changes record(calcout, "HL3A:SBPM:HL40:PSI_CTRL") { field(INPA, "HL3A:SBPM:HL40:PARMSEL CP") field(CALC, "A+1") field(DOPT, "Use CALC") field(OOPT, "On Change") field(OUT, "HL3A:SBPM:HL40:PSI_SEL.L PP") } record(longout, "HL3A:SBPM:HL40:PARMSEL") { field(VAL, "0") field(PINI, "YES") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBDEND # per BPM database for stripline BPMs ############################################## # This is the head of the main processing chain # that runs at the highest priority. ############################################## ############################################# # This is the head of the processing chain for # diagnostics. ############################################## record(ai, "HL3A:SBPM:HL41:GRN") { field(DESC, "GRN Strip Amplitude") field(DTYP, "Raw Bpm Signal") # 'card' selects PAD number, 'signal' selects strip field(INP, "#C5 S0") field(EGU, "raw") #TODO set HOPR/LOPR, alarm limits field(SCAN, "I/O Intr") # The priority determines what scan list we are being # put on (see drvPadUdpComm.c) field(PRIO, "LOW") field(FLNK, "HL3A:SBPM:HL41:RED") # HOPR for the energy algorithm is determined as follows: # # inf inf # 1) Fourier relation / h^2 dt = / |H|^2 df = 2 B # 0 -inf # # 1a) It can be shown that the maximum of the impuls response # ha is ~ 2 B # # 2) The digitizer produces the numbers # # Ai = 2^s (hi/ha) # # where ha is the maximum of the impuls response # and 2^s is a scale factor. # # 3) 'Energy algorithm' calculates S = sum( Ai^2 ) # # inf # 4) S = (2^s / ha)^2 sum(hi^2) = K sum(hi^2) Dt ~ K / h^2 dt # 0 # # with K = (2^s / ha)^2 fs # # 5) From 4) and 1a) -> S ~ K ha and therefore # # 6) S = 2^(2s) fs/ha = 2^(2s) fs/(2 B) # # 7) The strip signals are sqrt(S); hence HOPR is about # # HOPR ~ 2^s sqrt( fs/2/B ) # # with 2^s = 32768, fs=120MHz, B=10MHz it follows # that HOPR ~ 1E5; we add some margin... field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(ai, "HL3A:SBPM:HL41:RED") { field(DESC, "RED Strip Amplitude") field(DTYP, "Raw Bpm Signal") # 'card' selects PAD number, 'signal' selects strip field(INP, "#C5 S1") field(EGU, "raw") field(SCAN, "Passive") field(FLNK, "HL3A:SBPM:HL41:BLU") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(ai, "HL3A:SBPM:HL41:BLU") { field(DESC, "BLU Strip Amplitude") field(DTYP, "Raw Bpm Signal") # 'card' selects PAD number, 'signal' selects strip field(INP, "#C5 S2") field(EGU, "raw") field(SCAN, "Passive") field(FLNK, "HL3A:SBPM:HL41:YLO") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(ai, "HL3A:SBPM:HL41:YLO") { field(DESC, "YLO Strip Amplitude") field(DTYP, "Raw Bpm Signal") # 'card' selects PAD number, 'signal' selects strip field(INP, "#C5 S3") field(EGU, "raw") field(SCAN, "Passive") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } ############################################## # Slowly-scanned diagnostics ############################################## # record(waveform, "HL3A:SBPM:HL41:REDW") { field(DESC, "Raw CAL RED Data") field(DTYP, "WavBuf") # 'signal' number selects 'beam', 'calX', 'calY' field(INP, "#C5 S1") field(NELM, "512") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32768") field(LOPR, "-32767") field(SCAN, "1 second") } record(waveform, "HL3A:SBPM:HL41:GRNW") { field(DESC, "Raw CAL GRN Data") field(DTYP, "WavBuf") # 'signal' number selects 'beam', 'calX', 'calY' field(INP, "#C5 S2") field(NELM, "512") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32768") field(LOPR, "-32767") field(SCAN, "1 second") } record(waveform, "HL3A:SBPM:HL41:RAWDBG") { field(DESC, "Raw BEAM Dbg") field(DTYP, "WavBuf") # 'signal' number selects 'beam', 'calX', 'calY' # do not 'wbscan' for now since e.g., an underrange # condition on the real signal can happen. field(INP, "#C5 S7") field(NELM, "512") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32768") field(LOPR, "-32767") field(SCAN, "Passive") } record(waveform, "HL3A:SBPM:HL41:REDDBG") { field(DESC, "Raw CAL RED Dbg") field(DTYP, "WavBuf") # 'signal' number selects 'beam', 'calX', 'calY' field(INP, "#C5 S8 @wbscan") field(NELM, "512") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32768") field(LOPR, "-32767") field(SCAN, "Passive") } record(waveform, "HL3A:SBPM:HL41:GRNDBG") { field(DESC, "Raw CAL GRN Dbg") field(DTYP, "WavBuf") # 'signal' number selects 'beam', 'calX', 'calY' field(INP, "#C5 S9 @wbscan") field(NELM, "512") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32768") field(LOPR, "-32767") field(SCAN, "Passive") } record(ai, "HL3A:SBPM:HL41:GRUV") { field(DESC, "CAL Gain GRN/RED") field(DTYP, "Raw Stripl Calp") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C5 S0") field(SCAN, "10 second") field(PREC, "4") field(LOPR, "0.5") field(HOPR, "1.5") } record(ai, "HL3A:SBPM:HL41:GRU") { field(DESC, "CAL Gain GRN/BLU") field(DTYP, "Raw Stripl Calp") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C5 S1") field(SCAN, "10 second") field(PREC, "4") field(LOPR, "0.5") field(HOPR, "1.5") info(autosaveFields, "ASLO") } record(ai, "HL3A:SBPM:HL41:GRV") { field(DESC, "CAL Gain RED/YLO") field(DTYP, "Raw Stripl Calp") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C5 S2") field(SCAN, "10 second") field(PREC, "4") field(LOPR, "0.5") field(HOPR, "1.5") info(autosaveFields, "ASLO") } record(ai, "HL3A:SBPM:HL41:TGRN") { field(DESC, "Green arrival time") field(DTYP, "Raw Bpm Signal") field(EGU, "ADC Clocks") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C5 S4") field(SCAN, "10 second") field(PREC, "1") field(LOPR, "0") field(HOPR, "128") field(LOLO, "5") field(LOW, "8") field(HIGH, "60") field(HIHI, "70") field(LLSV, "MAJOR") field(LSV, "MINOR") field(HSV, "MINOR") field(HHSV, "MAJOR") } record(ai, "HL3A:SBPM:HL41:TRED") { field(DESC, "Red arrival time") field(DTYP, "Raw Bpm Signal") field(EGU, "ADC Clocks") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C5 S5") field(SCAN, "10 second") field(PREC, "1") field(LOPR, "0") field(HOPR, "128") field(LOLO, "5") field(LOW, "8") field(HIGH, "60") field(HIHI, "70") field(LLSV, "MAJOR") field(LSV, "MINOR") field(HSV, "MINOR") field(HHSV, "MAJOR") } record(ai, "HL3A:SBPM:HL41:TBLU") { field(DESC, "Blue arrival time") field(DTYP, "Raw Bpm Signal") field(EGU, "ADC Clocks") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C5 S6") field(SCAN, "10 second") field(PREC, "1") field(LOPR, "0") field(HOPR, "128") field(LOLO, "5") field(LOW, "8") field(HIGH, "60") field(HIHI, "70") field(LLSV, "MAJOR") field(LSV, "MINOR") field(HSV, "MINOR") field(HHSV, "MAJOR") } record(ai, "HL3A:SBPM:HL41:TYLO") { field(DESC, "Yellow arrival time") field(DTYP, "Raw Bpm Signal") field(EGU, "ADC Clocks") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C5 S7") field(SCAN, "10 second") field(PREC, "1") field(LOPR, "0") field(HOPR, "128") field(LOLO, "5") field(LOW, "8") field(HIGH, "60") field(HIHI, "70") field(LLSV, "MAJOR") field(LSV, "MINOR") field(HSV, "MINOR") field(HHSV, "MAJOR") } record(ao, "HL3A:SBPM:HL41:PINC_ADJ") { field(DESC, "Adjust Pinc. Corr.") field(DTYP, "Soft Channel") field(OUT, "HL3A:SBPM:HL41:CALC.K PP MS") field(VAL, "0") field(DRVL, "0") field(DRVH, "2") field(PINI, "YES") info(autosaveFields, "VAL") } # QSCL setting: # # Q: charge # Z: impedance # F: form factor: phi/(2 pi) sin(2 pi f l/c) # # Signal = Q Z F G h(t) = A h(t) [A] = Vs # # inf inf # Energy = A^2 / h^2(t) dt = A^2 / |H(w)|^2 dw/2/pi = A^2 B # 0 0 # # Measured energy = Sum{ (Vp/32768 * xi)^2 } / fs = S / fs ~ Energy # # -> A^2 B = S/fs # # With T = sqrt( Sum{ xi^2 } ) # # A = sqrt(S)/sqrt(B*fs) = T/sqrt(B*fs) Vp/32768 # # T/32768 Vp # Q = A/F/G/Z = ----------------- # F G Z sqrt(B*fs) # # Vp = { 1.5Vpp/2 (PGA=1) or 2.25Vpp/2 (PGA=0) } / 2 (transformer) # # I believe PGA is off (-> Vp ~ .56V) # # Z = 50 # # G: (calibration uses GRN/BLU -> signal should have the # level of the grn/red channels with the additional switch) # # Block diagram / parts / gain: # # [filt] [Att1] [Amp1] [Att2] [BPF] [Amp2] [pad] [Amp3] [switch] # f-17520 hmc540lp3 SBF-5089 hmc540lp3 MBP-140-6-4 SBF-4089 PAT-0 SBF-4089 HMC-197 # # -2dB* -1dB 20dB -1dB -4.5 14.8dB 0dB 14.8dB -0.4dB # # *: 1st filter ATT is a wild guess. # BPF loss (RLC Catalog, pp.55): (L (nsect+.5) / (% of 3dB BW) + .2) dB # with L ~6.2 10MHz/fc=140Mhz filter-> 4.5 # # -> Gtot ~ 40.7dB # # subtract cable loss (2dB); Gtot = 86 # # T/32768 Vp .56V/32768 # Q = A/F/G/Z = ----------------- = T/F ------------------------ # F G Z sqrt(B*fs) 86*50*sqrt(10*140)Mhz # # = T/F = 1.06E-7/F nC # # F for a 7% coverage, 4" BPM at 140MHz .07 sin(2*pi*140e6 4*.0254/3e8) # = .021 # # => 1.06E-7/.021 nC = 5E-6 nC # # (Faraday cup measurement -> (3600/44)^-1 1e-4 -> 1.22E-6 # record(ao, "HL3A:SBPM:HL41:QSCL") { field(DESC, "TMIT/Charge Scale") field(DTYP, "Soft Channel") field(OUT, "HL3A:SBPM:HL41:QSCA.A PP MS") # 5.0E-6 / 1.6E-10 [nC/e-] field(VAL, "31250") field(EGU, "Nel") field(PREC, "3") field(PINI, "YES") info(autosaveFields, "VAL") } # Adjust TMIT scale for AFE attenuation record(calcout, "HL3A:SBPM:HL41:QSCA") { field(DESC, "TMIT ATT Adj. Scale") field(INPB, "HL3A:SBPM:HL41:ATT1 CP") field(INPC, "HL3A:SBPM:HL41:ATT2 CP") field(CALC, "A*10^((B+C+D)/20)") # use CA link to deposit into TMIT.ASLO so # that TMIT is not forced into linkset # of this record field(OUT, "HL3A:SBPM:HL41:TMIT.ASLO CA") field(EGU, "Nel") field(PREC, "3") info(autosaveFields, "D") } record(ao, "HL3A:SBPM:HL41:ATT1SIMP") { field(DESC, "ATT1 Propagator") field(DTYP, "Soft Channel") field(DOL, "HL3A:SBPM:HL41:ATT1 CP") field(OMSL, "closed_loop") field(OUT, "HL3A:SBPM:HL41:ASIM.A PP") field(IVOA, "Set output to IVOV") field(IVOV, "0") field(EGU, "dB") } record(ao, "HL3A:SBPM:HL41:ATT2SIMP") { field(DESC, "ATT2 Propagator") field(DTYP, "Soft Channel") field(DOL, "HL3A:SBPM:HL41:ATT2 CP") field(OMSL, "closed_loop") field(OUT, "HL3A:SBPM:HL41:ASIM.C PP") field(IVOA, "Set output to IVOV") field(IVOV, "0") field(EGU, "dB") } # Attenuate charge either by # real attenuator settings or # by fake ones. # If B, C >= 0 then their # values will be used instead # of ATT1, ATT2 record(calcout, "HL3A:SBPM:HL41:ASIM") { field(DESC, "Q Simul Attenuator") field(DTYP, "Soft Channel") field(OUT, "HL3A:SBPM:HL41:QSIM.ESLO PP") # ATT1SIM puts value into A # set to -1 to use real attenuator settings # and >=0 to use B instead field(B, "-1") # ATT2SIM puts value into C # set to -1 to use real attenuator settings # and >=0 to use D instead field(D, "-1") field(CALC, "10^(((B>=0?B:A)+(D>=0?D:C))/20)") field(PINI, "YES") } record(ao, "HL3A:SBPM:HL41:WSIM") { field(DESC, "BPM W Simul.") field(DTYP, "Soft Channel") field(OUT, "HL3A:SBPM:HL41:SIM.G PP") field(VAL, "0.07") field(EGU, "%") field(PINI, "YES") field(PREC, "3") field(LOPR, "0") field(HOPR, "0.25") } record(sel, "HL3A:SBPM:HL41:STA") { field(DESC, "Status Summary") field(SELM, "High Signal") field(INPA, "HL3A:SBPM:HL41:RSTA.SEVR MS NPP") field(INPB, "HL3A:SBPM:HL41:TMIT.SEVR MS NPP") field(INPC, "HL3A:SBPM:HL41:Y.SEVR MS NPP") field(INPD, "HL3A:SBPM:HL41:X.SEVR MS NPP") field(INPE, "HL3A:SBPM:HL41:TGRN.SEVR MS NPP") field(INPF, "HL3A:SBPM:HL41:TRED.SEVR MS NPP") field(INPG, "HL3A:SBPM:HL41:TBLU.SEVR MS NPP") field(INPH, "HL3A:SBPM:HL41:TYLO.SEVR MS NPP") field(INPI, "HL3A:SBPM:HL41:GRU.SEVR MS NPP") field(INPJ, "HL3A:SBPM:HL41:GRV.SEVR MS NPP") field(SCAN, "1 second") } # This record really belongs on the # PAD IOC. We keep them here however # so we can save/restore. It is more # confusing but shouldn't matter from # an efficiency standpoint (they are # rarely changed). record(longout, "HL3A:SBPM:HL41:ATTO") { field(DESC, "AFE Tot. Att. Offset") # fetched via inlink #field(OUT, "HL3A:SBPM:HL41:ATTC.B PP") field(DRVL, "-10") field(DRVH, "30") field(LOPR, "-10") field(HOPR, "30") field(EGU, "dB") field(VAL, "0") field(PINI, "YES") info(autosaveFields, "VAL DRVH HOPR DRVL LOPR") } # This record really belongs on the # PAD IOC. We keep them here however # so we can save/restore. It is more # confusing but shouldn't matter from # an efficiency standpoint (they are # rarely changed). record(longout, "HL3A:SBPM:HL41:CLAO") { field(DESC, "AFE Cal. Att. Offset") # fetched via inlink #field(OUT, "HL3A:SBPM:HL41:ATTC.C PP") field(DRVL, "-20") field(DRVH, "20") field(LOPR, "-20") field(HOPR, "20") field(EGU, "dB") field(VAL, "40") field(PINI, "YES") info(autosaveFields, "VAL DRVH HOPR DRVL LOPR") } record(calc, "HL3A:SBPM:HL41:STA_ALH") { field(DESC, "Status Summary") field(SCAN, "1 second") field(CALC, "0") field(INPA, "HL3A:SBPM:HL41:RSTA_ALH.SEVR MS NPP") field(INPB, "HL3A:SBPM:HL41:GRU.SEVR MS NPP") field(INPC, "HL3A:SBPM:HL41:GRV.SEVR MS NPP") field(INPD, "HL3A:SBPM:HL41:CHK.SEVR MS NPP") field(INPE, "") field(INPF, "HL3A:SBPM:HL41:AFE_COMM.SEVR MS NPP") } # snapshot PV for the bpm values display record(ai, "HL3A:SBPM:HL41:GRN_SLOW") { field(DESC, "GRN snapshot for display") field(INP, "HL3A:SBPM:HL41:GRN NPP MS") field(EGU, "raw") field(SCAN, "1 second") field(FLNK, "HL3A:SBPM:HL41:RED_SLOW") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(ai, "HL3A:SBPM:HL41:RED_SLOW") { field(DESC, "RED snapshot for display") # 'card' selects PAD number, 'signal' selects strip field(INP, "HL3A:SBPM:HL41:RED NPP MS") field(EGU, "raw") field(SCAN, "Passive") field(FLNK, "HL3A:SBPM:HL41:BLU_SLOW") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(ai, "HL3A:SBPM:HL41:BLU_SLOW") { field(DESC, "BLU snapshot for display") # 'card' selects PAD number, 'signal' selects strip field(INP, "HL3A:SBPM:HL41:BLU NPP MS") field(EGU, "raw") field(SCAN, "Passive") field(FLNK, "HL3A:SBPM:HL41:YLO_SLOW") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(ai, "HL3A:SBPM:HL41:YLO_SLOW") { field(DESC, "YLO snapshot for display") field(INP, "HL3A:SBPM:HL41:YLO NPP MS") field(EGU, "raw") field(SCAN, "Passive") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(sub, "HL3A:SBPM:HL41:CALC") { field(SNAM, "drvBpmBvectSetupSub") # E: phi F: psi # BPM channel number in L field(INPL, "5") field(SCAN, "Passive") } record(bo, "HL3A:SBPM:HL41:PINC_ENA") { field(DESC, "Simple Pincushion Alg") field(DTYP, "BusAddress") field(OUT, "#C0S2@drvBpmStriplPincEna,m32") field(MASK, "32") field(ZNAM, "DISABLED") field(ONAM, "ENABLED") field(VAL, "0") field(PINI, "YES") info(autosaveFields, "VAL") } record(ao, "HL3A:SBPM:HL41:UDR_THRES") { field(DESC, "Detection Underrange Threshold") field(DTYP, "Bpm Parameters") field(OUT, "#C5S0") field(EGU, "ADC Ticks") field(DOL, "45.26") field(PINI, "YES") field(DRVL, "0") field(DRVH, "32767") info(autosaveFields, "VAL") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBDEND # per BPM database for stripline BPMs ###################################### # HEAD of main processing chain ###################################### record(ai, "HL3A:SBPM:HL41:X") { field(DESC, "X Position") field(EGU, "mm") field(DTYP, "Raw Bpm Signal") field(INP, "#C5 S11") field(SCAN, "I/O Intr") # The priority determines what scan list we are being # put on (see drvPadUdpComm.c) field(PRIO, "HIGH") field(FLNK, "HL3A:SBPM:HL41:Y") field(PREC, "4") field(LOPR, "-12") field(HOPR, "+12") field(ASG, "") field(TSE, "-2") info(autosaveFields, "ASLO LOLO LOW HIGH HIHI HHSV LLSV") } record(ai, "HL3A:SBPM:HL41:Y") { field(DESC, "Y Position") field(EGU, "mm") field(DTYP, "Raw Bpm Signal") field(INP, "#C5 S12") field(FLNK, "HL3A:SBPM:HL41:TMIT") field(PREC, "4") field(LOPR, "-12") field(HOPR, "+12") field(ASG, "") field(TSE, "-2") info(autosaveFields, "ASLO LOLO LOW HIGH HIHI HHSV LLSV") } record(ai, "HL3A:SBPM:HL41:TMIT") { field(DESC, "Charge Estimate") field(DTYP, "Raw Bpm Signal") field(INP, "#C5 S13") field(EGU, "Nel") field(PREC, "3") field(LOPR, "0") field(HOPR, "1E11") # FLINK into BSA field(FLNK, "HL3A:SBPM:HL41:EFX.PROC") field(ASG, "") field(TSE, "-2") info(autosaveFields, "LOLO LOW HIGH HIHI HHSV LLSV ") } ###################################### # HEAD of diagnostics processing chain ###################################### # leave RWAV in it's own lockset; don't FLNK # to 'U' & friends record(waveform, "HL3A:SBPM:HL41:RWAV") { field(DESC, "Raw BPM Data") field(DTYP, "WavBuf") # 'signal' number selects 'beam', 'calX', 'calY' field(INP, "#C5 S0") field(SCAN, "I/O Intr") # use LOW or HIGH to end up on the 'diagnostic' # scan list (see drvPadUdpComm.c) field(PRIO, "LOW") field(NELM, "512") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32768") field(LOPR, "-32767") } record(ai, "HL3A:SBPM:HL41:U") { field(DESC, "Raw U Position") field(DTYP, "Raw Bpm Signal") field(INP, "#C5 S8") field(SCAN, "I/O Intr") # use LOW or HIGH to end up on the 'diagnostic' # scan list (see drvPadUdpComm.c) field(PRIO, "LOW") field(PREC, "5") field(EGU, "mm") field(LOPR, "-0.7") field(HOPR, "+0.7") field(FLNK, "HL3A:SBPM:HL41:V") } record(ai, "HL3A:SBPM:HL41:V") { field(DESC, "Raw V Position") field(DTYP, "Raw Bpm Signal") field(INP, "#C5 S9") field(SCAN, "Passive") field(PREC, "5") field(EGU, "mm") field(LOPR, "-0.7") field(HOPR, "+0.7") field(FLNK, "HL3A:SBPM:HL41:PINC") } record(ai, "HL3A:SBPM:HL41:PINC") { field(DESC, "Pin Cushion Corr.") field(DTYP, "Raw Bpm Signal") field(INP, "#C5 S10") field(SCAN, "Passive") } record(longin, "HL3A:SBPM:HL41:RSTA") { field(DESC, "Status of Raw Processor") field(DTYP, "Bpm Raw Status") field(INP, "#C5S0") field(SCAN, "1 second") field(LOLO, "-1") field(HIHI, "+1") field(HHSV, "INVALID") field(LLSV, "INVALID") field(FLNK, "HL3A:SBPM:HL41:RSTA_ALH") } record(calc, "HL3A:SBPM:HL41:RSTA_ALH") { field(CALC, "A & B") field(INPA, "HL3A:SBPM:HL41:RSTA") field(INPB, "0x30F") field(HIHI, "1") field(LOLO, "-1") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(SCAN, "Passive") } ###################################### # Input/Parameteres ###################################### record(ao, "HL3A:SBPM:HL41:PHI") { field(DESC, "Rot Angle") field(DTYP, "Soft Channel") field(VAL, "0") field(EGU, "deg") field(PREC, "1") field(LOPR, "-180") field(HOPR, "+180") field(FLNK, "HL3A:SBPM:HL41:PHI_SEQ") } record(ao, "HL3A:SBPM:HL41:PSI") { field(DESC, "Axis Sep. Angle") field(DTYP, "Soft Channel") field(VAL, "90") field(EGU, "deg") field(PREC, "1") field(LOPR, "0") field(HOPR, "+180") field(FLNK, "HL3A:SBPM:HL41:PSI_SEQ") } #record(dfanout, "HL3A:SBPM:HL41:PCMM") { # field(DESC, "BPM Scale") # field(OUTA, "HL3A:SBPM:HL41:USCL PP MS") # field(OUTB, "HL3A:SBPM:HL41:VSCL PP MS") # field(VAL, "12") # field(EGU, "mm") # field(PREC, "4") # field(LOPR, "5") # field(HOPR, "15") # field(PINI, "YES") #} record(ao, "HL3A:SBPM:HL41:UOFF") { field(DESC, "BPM U Offset") field(DTYP, "Soft Channel") field(VAL, "0") field(EGU, "mm") field(PREC, "4") field(LOPR, "-5") field(HOPR, "+5") field(FLNK, "HL3A:SBPM:HL41:UOFF_SEQ") } record(ao, "HL3A:SBPM:HL41:VOFF") { field(DESC, "BPM V Offset") field(DTYP, "Soft Channel") field(VAL, "0") field(EGU, "mm") field(PREC, "4") field(LOPR, "-5") field(HOPR, "+5") field(FLNK, "HL3A:SBPM:HL41:VOFF_SEQ") } record(ao, "HL3A:SBPM:HL41:USCL") { field(DESC, "BPM U Scale") field(DTYP, "Soft Channel") field(VAL, "1") field(EGU, "mm") field(PREC, "4") field(FLNK, "HL3A:SBPM:HL41:USCL_SEQ") } record(ao, "HL3A:SBPM:HL41:VSCL") { field(DESC, "BPM V Scale") field(DTYP, "Soft Channel") field(VAL, "1") field(EGU, "mm") field(PREC, "4") field(FLNK, "HL3A:SBPM:HL41:VSCL_SEQ") } record(mbbo, "HL3A:SBPM:HL41:ACCESS") { field(DESC, "BPM On Line") field(DTYP, "StreamSwitch") field(OUT, "#C5 S0") field(ZRVL, "1") field(ZRST, "Running") field(ZRSV, "NO_ALARM") field(ONVL, "1") field(ONST, "Maintenance") field(ONSV, "MINOR") field(TWVL, "1") field(TWST, "Test") field(TWSV, "MINOR") field(THVL, "0") field(THST, "OFFLINE") field(THSV, "MAJOR") # set both, rval and val to get it right # regardless of whether devsup does conversion # or not. field(RVAL, "0") field(VAL, "0") field(PINI, "YES") field(FLNK, "HL3A:SBPM:HL41:SIMOFF") info(autosaveFields, "RVAL") } # # 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, "HL3A:SBPM:HL41:FBCK") { field(DESC, "Feedback State") field(PINI, "YES") field(OMSL, "supervisory") field(VAL, "0") field(ZRVL, "0") field(ONVL, "1") field(TWVL, "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") info(autosaveFields, "VAL") } # Convenience record holding the MAD name record(stringin, "HL3A:SBPM:HL41:MADN") { field(DESC, "MAD Name") field(VAL, "SBPMHL41") field(PINI, "YES") } record(stringin, "SBPMHL41:NAME") { field(DESC, "BPM Name") field(VAL, "HL3A:SBPM:HL41") field(PINI, "YES") } record(ai, "HL3A:SBPM:HL41:X_SLOW") { #alias("HL3A:SBPM:HL41:X1H") field(DESC, "X snapshot for display") field(EGU, "mm") field(INP, "HL3A:SBPM:HL41:X MS") field(FLNK, "HL3A:SBPM:HL41:Y_SLOW") field(PREC, "4") field(SCAN, "1 second") field(LOPR, "-12") field(HOPR, "+12") } record(ai, "HL3A:SBPM:HL41:Y_SLOW") { #alias("HL3A:SBPM:HL41:Y1H") field(DESC, "Y snapshot for display") field(EGU, "mm") field(INP, "HL3A:SBPM:HL41:Y NPP MS") field(FLNK, "HL3A:SBPM:HL41:TMIT_SLOW") field(PREC, "4") field(LOPR, "-12") field(HOPR, "+12") } record(ai, "HL3A:SBPM:HL41:TMIT_SLOW") { #alias("HL3A:SBPM:HL41:TMIT1H") field(DESC, "TMIT snapshot for display") field(INP, "HL3A:SBPM:HL41:TMIT NPP MS") field(EGU, "Nel") field(PREC, "3") field(LOPR, "0") field(HOPR, "1E11") } ###################################### # Simulation Parameters + Control ###################################### # switch off simulation when going off-line record(calcout, "HL3A:SBPM:HL41:SIMOFF") { field(DESC, "Sim Off Propagator") field(INPA, "HL3A:SBPM:HL41:ACCESS.RVAL") field(CALC, "A") field(OCAL, "0") field(OOPT, "When Zero") field(DOPT, "Use OCAL") field(OUT, "HL3A:SBPM:HL41:SIMC PP") } record(calcout, "HL3A:SBPM:HL41:SIM") { field(DESC, "BPM Pos. Simulation") field(DTYP, "Strip Signal Simulator") field(OUT, "5") #CALC & VAL unused; the real calculation is done # in device support. The reason this is a # calcout rather than sub is that we want # to use the OUT link... field(CALC, "A") field(INPA, "HL3A:SBPM:HL41:USCL") field(INPL, "0") } # Switch simulation record HL3A:SBPM:HL41:SIMCSEQ moved to # bpmCavity.db.part and bpmStripl.db.part record(mbbo, "HL3A:SBPM:HL41:SIMC") { field(DESC, "Stripl Sim Ctl") field(DTYP, "Raw Soft Channel") field(OUT, "HL3A:SBPM:HL41:SIMCSEQ.SELN PP") field(ZRST, "OFF") field(ZRVL, "0x0f") field(ONST, "ON") field(ONVL, "0x1c0") field(TWST, "SOFT") field(TWVL, "0x030") field(MASK, "-1") field(NOBT, "16") field(VAL, "0") field(RVAL, "0x0f") field(PINI, "YES") } record(ao, "HL3A:SBPM:HL41:XSIM") { field(DESC, "BPM X Pos. Simul.") field(DTYP, "Soft Channel") field(OUT, "HL3A:SBPM:HL41:SIM.B PP") field(VAL, "0.5") field(EGU, "mm") field(PINI, "YES") field(PREC, "4") field(LOPR, "-12") field(HOPR, "+12") } record(ao, "HL3A:SBPM:HL41:YSIM") { field(DESC, "BPM Y Pos. Simul.") field(DTYP, "Soft Channel") field(OUT, "HL3A:SBPM:HL41:SIM.C PP") field(VAL, "0.") field(EGU, "mm") field(PINI, "YES") field(PREC, "4") field(LOPR, "-12") field(HOPR, "+12") } record(ao, "HL3A:SBPM:HL41:QSIM") { field(DESC, "BPM Q Simul.") field(DTYP, "Raw Soft Channel") field(OUT, "HL3A:SBPM:HL41:SIM.D PP") field(EGU, "Nel") field(ASLO, "6000") #ESLO is used to add attenuation field(LINR, "LINEAR") field(VAL, "1E9") field(PINI, "YES") field(PREC, "4") field(LOPR, "0") field(HOPR, "1E11") } record(ao, "HL3A:SBPM:HL41:ROTS") { field(DESC, "BPM Rot. Simul.") field(DTYP, "Soft Channel") field(OUT, "HL3A:SBPM:HL41:SIM.E PP") field(VAL, "0.") field(EGU, "deg") field(PINI, "YES") field(PREC, "1") field(LOPR, "-180") } record(ao, "HL3A:SBPM:HL41:PSIS") { field(DESC, "BPM Angle. Simul.") field(DTYP, "Soft Channel") field(OUT, "HL3A:SBPM:HL41:SIM.F PP") field(VAL, "90") field(EGU, "deg") field(PINI, "YES") field(PREC, "1") field(LOPR, "0") } record(aao, "HL3A:SBPM:HL41:DIGISIMW") { field(DESC, "VME Digi Sim. Waveform") field(DTYP, "VmeDigi Sim Wav") field(OUT, "#C5 S0") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32678") field(LOPR, "-32768") # 16384 samples/channel * 4 channels field(NELM, "65536") field(PINI, "NO") } #Used by model/database folks to verify BPM record(ao, "HL3A:SBPM:HL41:Z") { field(DESC, "Z Position") field(PINI, "YES") info(autosaveFields, "VAL") } # MPS interface record(bo, "HL3A:SBPM:HL41:MPSBYP") { field(DESC, "MPS Bypass") field(DTYP, "BusAddress") field(OUT, "#C0S2@bpmMPS+0,m32") field(MASK, "32") field(ZNAM, "BYPASSED") field(ONAM, "NOT_BYPASSED") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(VAL, "0") field(PINI, "YES") field(ASG, "") info(autosaveFields, "VAL") } record(bo, "HL3A:SBPM:HL41:MPSLTBYP") { field(DESC, "MPS Bypass") field(DTYP, "BusAddress") field(OUT, "#C1S2@bpmMPS+0,m32") field(MASK, "32") field(ZNAM, "BYPASSED") field(ONAM, "NOT_BYPASSED") field(ZSV, "NO_ALARM") field(OSV, "NO_ALARM") field(VAL, "0") field(PINI, "YES") field(ASG, "") info(autosaveFields, "VAL") } record(calc, "HL3A:SBPM:HL41:MPSIGNRCALC") { field(DESC, "MPS ignore if TMIT too low") field(CALC, "A $[parm]_SEQ # # Different values of the parameter # $[parm0]..$[parm9] are stored in # $[parm]_SEL.A .. $[parm]_SEL.J # # The actual value of the parameter is # selected based on the value of a controlling # PV $[ctrl] using a 'mapping' CALC expression # $[mapc] to convert the $[ctrl] value into # the integer range 1..10. # # The selected value of $[parm] is written # to output link $[outl] # # A) When the user writes $[parm] then # its value is deposited in the currently # selected field of $[parm]_SEL and # propagated to $[outl] # # B) When the user writes any of $[parm]_SEL.A..J # then the value is stored there. If she # writes to the currently 'active' field\ # (as selected by $[ctrl]) then # the $[parm] PV itself is updated and the # value is also propagated to $[outl] # # C) If the user changes $[ctrl] then the # corresponding value $[parm]_SEL.A..J is # propagated to $[outl] and $[parm]. # # D) At initialization, the value corresponding # to the initial setting of $[ctrl] is written # to $[outl] and $[parm] # # MACROS: # # $[parm] PV holding the parameter # $[ctrl] PV that controls the selection of # the currently active setting of # $[parm] # $[outl] PV where the currently selected # value of $[parm] shall be written-to # (if applicable) # $[prec] Precision of the $[parm]_SEL variable # (should be set to same value as $[parm].PREC) # # $[parm0]..$[parm9] initial values of $[parm] # # $[mapc] CALC expression to convert the value # of the controlling PV which is available # as 'A' to the range 1..10 (or less if # less selections are used). # E.g., to convert the value of a bo (0/1) # you would set mapc to 'A+1' (0..1 -> 1..2) # # NOTE: This sb snippet is loaded/expanded # for every parameter under control # of $[ctrl]. ALSO, the companion # snippet parmCtl.db must be loaded/expanded # but only once per controlling PV. # # This record, when scanned (as a result # of $[parm] being written and processing # its FLNK to this record] fetches $[parm] # and deposits the value into the currently # selected field of the SEL record. # # NOTE: unfortunately, the selection # mechanism of the SEQ and SEL # records differs: SEQ is 1-based, # SEL is 0-based -- now that makes # sense, doesn't it? # record(seq, "HL3A:SBPM:HL41:UOFF_SEQ") { field(DESC, "Propagate Parm -> SEL") field(DOL1, "HL3A:SBPM:HL41:UOFF") field(DOL2, "HL3A:SBPM:HL41:UOFF") field(DOL3, "HL3A:SBPM:HL41:UOFF") field(DOL4, "HL3A:SBPM:HL41:UOFF") field(DOL5, "HL3A:SBPM:HL41:UOFF") field(DOL6, "HL3A:SBPM:HL41:UOFF") field(DOL7, "HL3A:SBPM:HL41:UOFF") field(DOL8, "HL3A:SBPM:HL41:UOFF") field(DOL9, "HL3A:SBPM:HL41:UOFF") field(DOLA, "HL3A:SBPM:HL41:UOFF") field(LNK1, "HL3A:SBPM:HL41:UOFF_SEL.A PP") field(LNK2, "HL3A:SBPM:HL41:UOFF_SEL.B PP") field(LNK3, "HL3A:SBPM:HL41:UOFF_SEL.C PP") field(LNK4, "HL3A:SBPM:HL41:UOFF_SEL.D PP") field(LNK5, "HL3A:SBPM:HL41:UOFF_SEL.E PP") field(LNK6, "HL3A:SBPM:HL41:UOFF_SEL.F PP") field(LNK7, "HL3A:SBPM:HL41:UOFF_SEL.G PP") field(LNK8, "HL3A:SBPM:HL41:UOFF_SEL.H PP") field(LNK9, "HL3A:SBPM:HL41:UOFF_SEL.I PP") field(LNKA, "HL3A:SBPM:HL41:UOFF_SEL.J PP") field(SELM, "Specified") field(SELL, "HL3A:SBPM:HL41:UOFF_CTRL NPP NMS") } # The $[parm]_SEL record holds all possible # values of $[parm] in the 'A..J' fields. # # When processed it updates it's own VAL # to the currently selected input. Input # 'L' serves as the (1-based) selector, # i.e., L==1 selects 'A'->'VAL'. # # When the selected value changes (as a # result of SEQ depositing a new value OR # $[ctrl] changing and updating L) then # the propagator record attached to the # FLNK is processed. # record(sub, "HL3A:SBPM:HL41:UOFF_SEL") { # field(INAM, "parmSelSubInit") field(SNAM, "parmSelSubProc") field(A, "0") field(B, "0") field(C, "") field(D, "") field(E, "") field(F, "") field(G, "") field(H, "") field(I, "") field(J, "") field(PREC, "4") field(FLNK, "HL3A:SBPM:HL41:UOFF_PROP") info(autosaveFields, "A B C D E F G H I J") } # # Finally the dfanout record # fetches the currently selected # value from SEL and propagates it # to $[outl]. It also updates # $[parm] itself so that $[parm] # always reflects the currently # selected value. # record(dfanout, "HL3A:SBPM:HL41:UOFF_PROP") { field(OMSL, "closed_loop") field(DOL, "HL3A:SBPM:HL41:UOFF_SEL") field(OUTA, "HL3A:SBPM:HL41:U.AOFF CA") field(OUTB, "HL3A:SBPM:HL41:UOFF PP") } # Drive the SEL record when the 'ctrl' PV changes # Use a CA link to monitor such changes record(calcout, "HL3A:SBPM:HL41:UOFF_CTRL") { field(INPA, "HL3A:SBPM:HL41:PARMSEL CP") field(CALC, "A+1") field(DOPT, "Use CALC") field(OOPT, "On Change") field(OUT, "HL3A:SBPM:HL41:UOFF_SEL.L PP") } # Maintain multiple (up to 10) values of # a parameter: # # Record holding the parameter $[parm] # must FLNK -> $[parm]_SEQ # # Different values of the parameter # $[parm0]..$[parm9] are stored in # $[parm]_SEL.A .. $[parm]_SEL.J # # The actual value of the parameter is # selected based on the value of a controlling # PV $[ctrl] using a 'mapping' CALC expression # $[mapc] to convert the $[ctrl] value into # the integer range 1..10. # # The selected value of $[parm] is written # to output link $[outl] # # A) When the user writes $[parm] then # its value is deposited in the currently # selected field of $[parm]_SEL and # propagated to $[outl] # # B) When the user writes any of $[parm]_SEL.A..J # then the value is stored there. If she # writes to the currently 'active' field\ # (as selected by $[ctrl]) then # the $[parm] PV itself is updated and the # value is also propagated to $[outl] # # C) If the user changes $[ctrl] then the # corresponding value $[parm]_SEL.A..J is # propagated to $[outl] and $[parm]. # # D) At initialization, the value corresponding # to the initial setting of $[ctrl] is written # to $[outl] and $[parm] # # MACROS: # # $[parm] PV holding the parameter # $[ctrl] PV that controls the selection of # the currently active setting of # $[parm] # $[outl] PV where the currently selected # value of $[parm] shall be written-to # (if applicable) # $[prec] Precision of the $[parm]_SEL variable # (should be set to same value as $[parm].PREC) # # $[parm0]..$[parm9] initial values of $[parm] # # $[mapc] CALC expression to convert the value # of the controlling PV which is available # as 'A' to the range 1..10 (or less if # less selections are used). # E.g., to convert the value of a bo (0/1) # you would set mapc to 'A+1' (0..1 -> 1..2) # # NOTE: This sb snippet is loaded/expanded # for every parameter under control # of $[ctrl]. ALSO, the companion # snippet parmCtl.db must be loaded/expanded # but only once per controlling PV. # # This record, when scanned (as a result # of $[parm] being written and processing # its FLNK to this record] fetches $[parm] # and deposits the value into the currently # selected field of the SEL record. # # NOTE: unfortunately, the selection # mechanism of the SEQ and SEL # records differs: SEQ is 1-based, # SEL is 0-based -- now that makes # sense, doesn't it? # record(seq, "HL3A:SBPM:HL41:VOFF_SEQ") { field(DESC, "Propagate Parm -> SEL") field(DOL1, "HL3A:SBPM:HL41:VOFF") field(DOL2, "HL3A:SBPM:HL41:VOFF") field(DOL3, "HL3A:SBPM:HL41:VOFF") field(DOL4, "HL3A:SBPM:HL41:VOFF") field(DOL5, "HL3A:SBPM:HL41:VOFF") field(DOL6, "HL3A:SBPM:HL41:VOFF") field(DOL7, "HL3A:SBPM:HL41:VOFF") field(DOL8, "HL3A:SBPM:HL41:VOFF") field(DOL9, "HL3A:SBPM:HL41:VOFF") field(DOLA, "HL3A:SBPM:HL41:VOFF") field(LNK1, "HL3A:SBPM:HL41:VOFF_SEL.A PP") field(LNK2, "HL3A:SBPM:HL41:VOFF_SEL.B PP") field(LNK3, "HL3A:SBPM:HL41:VOFF_SEL.C PP") field(LNK4, "HL3A:SBPM:HL41:VOFF_SEL.D PP") field(LNK5, "HL3A:SBPM:HL41:VOFF_SEL.E PP") field(LNK6, "HL3A:SBPM:HL41:VOFF_SEL.F PP") field(LNK7, "HL3A:SBPM:HL41:VOFF_SEL.G PP") field(LNK8, "HL3A:SBPM:HL41:VOFF_SEL.H PP") field(LNK9, "HL3A:SBPM:HL41:VOFF_SEL.I PP") field(LNKA, "HL3A:SBPM:HL41:VOFF_SEL.J PP") field(SELM, "Specified") field(SELL, "HL3A:SBPM:HL41:VOFF_CTRL NPP NMS") } # The $[parm]_SEL record holds all possible # values of $[parm] in the 'A..J' fields. # # When processed it updates it's own VAL # to the currently selected input. Input # 'L' serves as the (1-based) selector, # i.e., L==1 selects 'A'->'VAL'. # # When the selected value changes (as a # result of SEQ depositing a new value OR # $[ctrl] changing and updating L) then # the propagator record attached to the # FLNK is processed. # record(sub, "HL3A:SBPM:HL41:VOFF_SEL") { # field(INAM, "parmSelSubInit") field(SNAM, "parmSelSubProc") field(A, "0") field(B, "0") field(C, "") field(D, "") field(E, "") field(F, "") field(G, "") field(H, "") field(I, "") field(J, "") field(PREC, "4") field(FLNK, "HL3A:SBPM:HL41:VOFF_PROP") info(autosaveFields, "A B C D E F G H I J") } # # Finally the dfanout record # fetches the currently selected # value from SEL and propagates it # to $[outl]. It also updates # $[parm] itself so that $[parm] # always reflects the currently # selected value. # record(dfanout, "HL3A:SBPM:HL41:VOFF_PROP") { field(OMSL, "closed_loop") field(DOL, "HL3A:SBPM:HL41:VOFF_SEL") field(OUTA, "HL3A:SBPM:HL41:V.AOFF CA") field(OUTB, "HL3A:SBPM:HL41:VOFF PP") } # Drive the SEL record when the 'ctrl' PV changes # Use a CA link to monitor such changes record(calcout, "HL3A:SBPM:HL41:VOFF_CTRL") { field(INPA, "HL3A:SBPM:HL41:PARMSEL CP") field(CALC, "A+1") field(DOPT, "Use CALC") field(OOPT, "On Change") field(OUT, "HL3A:SBPM:HL41:VOFF_SEL.L PP") } # Maintain multiple (up to 10) values of # a parameter: # # Record holding the parameter $[parm] # must FLNK -> $[parm]_SEQ # # Different values of the parameter # $[parm0]..$[parm9] are stored in # $[parm]_SEL.A .. $[parm]_SEL.J # # The actual value of the parameter is # selected based on the value of a controlling # PV $[ctrl] using a 'mapping' CALC expression # $[mapc] to convert the $[ctrl] value into # the integer range 1..10. # # The selected value of $[parm] is written # to output link $[outl] # # A) When the user writes $[parm] then # its value is deposited in the currently # selected field of $[parm]_SEL and # propagated to $[outl] # # B) When the user writes any of $[parm]_SEL.A..J # then the value is stored there. If she # writes to the currently 'active' field\ # (as selected by $[ctrl]) then # the $[parm] PV itself is updated and the # value is also propagated to $[outl] # # C) If the user changes $[ctrl] then the # corresponding value $[parm]_SEL.A..J is # propagated to $[outl] and $[parm]. # # D) At initialization, the value corresponding # to the initial setting of $[ctrl] is written # to $[outl] and $[parm] # # MACROS: # # $[parm] PV holding the parameter # $[ctrl] PV that controls the selection of # the currently active setting of # $[parm] # $[outl] PV where the currently selected # value of $[parm] shall be written-to # (if applicable) # $[prec] Precision of the $[parm]_SEL variable # (should be set to same value as $[parm].PREC) # # $[parm0]..$[parm9] initial values of $[parm] # # $[mapc] CALC expression to convert the value # of the controlling PV which is available # as 'A' to the range 1..10 (or less if # less selections are used). # E.g., to convert the value of a bo (0/1) # you would set mapc to 'A+1' (0..1 -> 1..2) # # NOTE: This sb snippet is loaded/expanded # for every parameter under control # of $[ctrl]. ALSO, the companion # snippet parmCtl.db must be loaded/expanded # but only once per controlling PV. # # This record, when scanned (as a result # of $[parm] being written and processing # its FLNK to this record] fetches $[parm] # and deposits the value into the currently # selected field of the SEL record. # # NOTE: unfortunately, the selection # mechanism of the SEQ and SEL # records differs: SEQ is 1-based, # SEL is 0-based -- now that makes # sense, doesn't it? # record(seq, "HL3A:SBPM:HL41:USCL_SEQ") { field(DESC, "Propagate Parm -> SEL") field(DOL1, "HL3A:SBPM:HL41:USCL") field(DOL2, "HL3A:SBPM:HL41:USCL") field(DOL3, "HL3A:SBPM:HL41:USCL") field(DOL4, "HL3A:SBPM:HL41:USCL") field(DOL5, "HL3A:SBPM:HL41:USCL") field(DOL6, "HL3A:SBPM:HL41:USCL") field(DOL7, "HL3A:SBPM:HL41:USCL") field(DOL8, "HL3A:SBPM:HL41:USCL") field(DOL9, "HL3A:SBPM:HL41:USCL") field(DOLA, "HL3A:SBPM:HL41:USCL") field(LNK1, "HL3A:SBPM:HL41:USCL_SEL.A PP") field(LNK2, "HL3A:SBPM:HL41:USCL_SEL.B PP") field(LNK3, "HL3A:SBPM:HL41:USCL_SEL.C PP") field(LNK4, "HL3A:SBPM:HL41:USCL_SEL.D PP") field(LNK5, "HL3A:SBPM:HL41:USCL_SEL.E PP") field(LNK6, "HL3A:SBPM:HL41:USCL_SEL.F PP") field(LNK7, "HL3A:SBPM:HL41:USCL_SEL.G PP") field(LNK8, "HL3A:SBPM:HL41:USCL_SEL.H PP") field(LNK9, "HL3A:SBPM:HL41:USCL_SEL.I PP") field(LNKA, "HL3A:SBPM:HL41:USCL_SEL.J PP") field(SELM, "Specified") field(SELL, "HL3A:SBPM:HL41:USCL_CTRL NPP NMS") } # The $[parm]_SEL record holds all possible # values of $[parm] in the 'A..J' fields. # # When processed it updates it's own VAL # to the currently selected input. Input # 'L' serves as the (1-based) selector, # i.e., L==1 selects 'A'->'VAL'. # # When the selected value changes (as a # result of SEQ depositing a new value OR # $[ctrl] changing and updating L) then # the propagator record attached to the # FLNK is processed. # record(sub, "HL3A:SBPM:HL41:USCL_SEL") { # field(INAM, "parmSelSubInit") field(SNAM, "parmSelSubProc") field(A, "1") field(B, "1") field(C, "") field(D, "") field(E, "") field(F, "") field(G, "") field(H, "") field(I, "") field(J, "") field(PREC, "4") field(FLNK, "HL3A:SBPM:HL41:USCL_PROP") info(autosaveFields, "A B C D E F G H I J") } # # Finally the dfanout record # fetches the currently selected # value from SEL and propagates it # to $[outl]. It also updates # $[parm] itself so that $[parm] # always reflects the currently # selected value. # record(dfanout, "HL3A:SBPM:HL41:USCL_PROP") { field(OMSL, "closed_loop") field(DOL, "HL3A:SBPM:HL41:USCL_SEL") field(OUTA, "HL3A:SBPM:HL41:U.ASLO CA") field(OUTB, "HL3A:SBPM:HL41:USCL PP") } # Drive the SEL record when the 'ctrl' PV changes # Use a CA link to monitor such changes record(calcout, "HL3A:SBPM:HL41:USCL_CTRL") { field(INPA, "HL3A:SBPM:HL41:PARMSEL CP") field(CALC, "A+1") field(DOPT, "Use CALC") field(OOPT, "On Change") field(OUT, "HL3A:SBPM:HL41:USCL_SEL.L PP") } # Maintain multiple (up to 10) values of # a parameter: # # Record holding the parameter $[parm] # must FLNK -> $[parm]_SEQ # # Different values of the parameter # $[parm0]..$[parm9] are stored in # $[parm]_SEL.A .. $[parm]_SEL.J # # The actual value of the parameter is # selected based on the value of a controlling # PV $[ctrl] using a 'mapping' CALC expression # $[mapc] to convert the $[ctrl] value into # the integer range 1..10. # # The selected value of $[parm] is written # to output link $[outl] # # A) When the user writes $[parm] then # its value is deposited in the currently # selected field of $[parm]_SEL and # propagated to $[outl] # # B) When the user writes any of $[parm]_SEL.A..J # then the value is stored there. If she # writes to the currently 'active' field\ # (as selected by $[ctrl]) then # the $[parm] PV itself is updated and the # value is also propagated to $[outl] # # C) If the user changes $[ctrl] then the # corresponding value $[parm]_SEL.A..J is # propagated to $[outl] and $[parm]. # # D) At initialization, the value corresponding # to the initial setting of $[ctrl] is written # to $[outl] and $[parm] # # MACROS: # # $[parm] PV holding the parameter # $[ctrl] PV that controls the selection of # the currently active setting of # $[parm] # $[outl] PV where the currently selected # value of $[parm] shall be written-to # (if applicable) # $[prec] Precision of the $[parm]_SEL variable # (should be set to same value as $[parm].PREC) # # $[parm0]..$[parm9] initial values of $[parm] # # $[mapc] CALC expression to convert the value # of the controlling PV which is available # as 'A' to the range 1..10 (or less if # less selections are used). # E.g., to convert the value of a bo (0/1) # you would set mapc to 'A+1' (0..1 -> 1..2) # # NOTE: This sb snippet is loaded/expanded # for every parameter under control # of $[ctrl]. ALSO, the companion # snippet parmCtl.db must be loaded/expanded # but only once per controlling PV. # # This record, when scanned (as a result # of $[parm] being written and processing # its FLNK to this record] fetches $[parm] # and deposits the value into the currently # selected field of the SEL record. # # NOTE: unfortunately, the selection # mechanism of the SEQ and SEL # records differs: SEQ is 1-based, # SEL is 0-based -- now that makes # sense, doesn't it? # record(seq, "HL3A:SBPM:HL41:VSCL_SEQ") { field(DESC, "Propagate Parm -> SEL") field(DOL1, "HL3A:SBPM:HL41:VSCL") field(DOL2, "HL3A:SBPM:HL41:VSCL") field(DOL3, "HL3A:SBPM:HL41:VSCL") field(DOL4, "HL3A:SBPM:HL41:VSCL") field(DOL5, "HL3A:SBPM:HL41:VSCL") field(DOL6, "HL3A:SBPM:HL41:VSCL") field(DOL7, "HL3A:SBPM:HL41:VSCL") field(DOL8, "HL3A:SBPM:HL41:VSCL") field(DOL9, "HL3A:SBPM:HL41:VSCL") field(DOLA, "HL3A:SBPM:HL41:VSCL") field(LNK1, "HL3A:SBPM:HL41:VSCL_SEL.A PP") field(LNK2, "HL3A:SBPM:HL41:VSCL_SEL.B PP") field(LNK3, "HL3A:SBPM:HL41:VSCL_SEL.C PP") field(LNK4, "HL3A:SBPM:HL41:VSCL_SEL.D PP") field(LNK5, "HL3A:SBPM:HL41:VSCL_SEL.E PP") field(LNK6, "HL3A:SBPM:HL41:VSCL_SEL.F PP") field(LNK7, "HL3A:SBPM:HL41:VSCL_SEL.G PP") field(LNK8, "HL3A:SBPM:HL41:VSCL_SEL.H PP") field(LNK9, "HL3A:SBPM:HL41:VSCL_SEL.I PP") field(LNKA, "HL3A:SBPM:HL41:VSCL_SEL.J PP") field(SELM, "Specified") field(SELL, "HL3A:SBPM:HL41:VSCL_CTRL NPP NMS") } # The $[parm]_SEL record holds all possible # values of $[parm] in the 'A..J' fields. # # When processed it updates it's own VAL # to the currently selected input. Input # 'L' serves as the (1-based) selector, # i.e., L==1 selects 'A'->'VAL'. # # When the selected value changes (as a # result of SEQ depositing a new value OR # $[ctrl] changing and updating L) then # the propagator record attached to the # FLNK is processed. # record(sub, "HL3A:SBPM:HL41:VSCL_SEL") { # field(INAM, "parmSelSubInit") field(SNAM, "parmSelSubProc") field(A, "1") field(B, "1") field(C, "") field(D, "") field(E, "") field(F, "") field(G, "") field(H, "") field(I, "") field(J, "") field(PREC, "4") field(FLNK, "HL3A:SBPM:HL41:VSCL_PROP") info(autosaveFields, "A B C D E F G H I J") } # # Finally the dfanout record # fetches the currently selected # value from SEL and propagates it # to $[outl]. It also updates # $[parm] itself so that $[parm] # always reflects the currently # selected value. # record(dfanout, "HL3A:SBPM:HL41:VSCL_PROP") { field(OMSL, "closed_loop") field(DOL, "HL3A:SBPM:HL41:VSCL_SEL") field(OUTA, "HL3A:SBPM:HL41:V.ASLO CA") field(OUTB, "HL3A:SBPM:HL41:VSCL PP") } # Drive the SEL record when the 'ctrl' PV changes # Use a CA link to monitor such changes record(calcout, "HL3A:SBPM:HL41:VSCL_CTRL") { field(INPA, "HL3A:SBPM:HL41:PARMSEL CP") field(CALC, "A+1") field(DOPT, "Use CALC") field(OOPT, "On Change") field(OUT, "HL3A:SBPM:HL41:VSCL_SEL.L PP") } # Maintain multiple (up to 10) values of # a parameter: # # Record holding the parameter $[parm] # must FLNK -> $[parm]_SEQ # # Different values of the parameter # $[parm0]..$[parm9] are stored in # $[parm]_SEL.A .. $[parm]_SEL.J # # The actual value of the parameter is # selected based on the value of a controlling # PV $[ctrl] using a 'mapping' CALC expression # $[mapc] to convert the $[ctrl] value into # the integer range 1..10. # # The selected value of $[parm] is written # to output link $[outl] # # A) When the user writes $[parm] then # its value is deposited in the currently # selected field of $[parm]_SEL and # propagated to $[outl] # # B) When the user writes any of $[parm]_SEL.A..J # then the value is stored there. If she # writes to the currently 'active' field\ # (as selected by $[ctrl]) then # the $[parm] PV itself is updated and the # value is also propagated to $[outl] # # C) If the user changes $[ctrl] then the # corresponding value $[parm]_SEL.A..J is # propagated to $[outl] and $[parm]. # # D) At initialization, the value corresponding # to the initial setting of $[ctrl] is written # to $[outl] and $[parm] # # MACROS: # # $[parm] PV holding the parameter # $[ctrl] PV that controls the selection of # the currently active setting of # $[parm] # $[outl] PV where the currently selected # value of $[parm] shall be written-to # (if applicable) # $[prec] Precision of the $[parm]_SEL variable # (should be set to same value as $[parm].PREC) # # $[parm0]..$[parm9] initial values of $[parm] # # $[mapc] CALC expression to convert the value # of the controlling PV which is available # as 'A' to the range 1..10 (or less if # less selections are used). # E.g., to convert the value of a bo (0/1) # you would set mapc to 'A+1' (0..1 -> 1..2) # # NOTE: This sb snippet is loaded/expanded # for every parameter under control # of $[ctrl]. ALSO, the companion # snippet parmCtl.db must be loaded/expanded # but only once per controlling PV. # # This record, when scanned (as a result # of $[parm] being written and processing # its FLNK to this record] fetches $[parm] # and deposits the value into the currently # selected field of the SEL record. # # NOTE: unfortunately, the selection # mechanism of the SEQ and SEL # records differs: SEQ is 1-based, # SEL is 0-based -- now that makes # sense, doesn't it? # record(seq, "HL3A:SBPM:HL41:PHI_SEQ") { field(DESC, "Propagate Parm -> SEL") field(DOL1, "HL3A:SBPM:HL41:PHI") field(DOL2, "HL3A:SBPM:HL41:PHI") field(DOL3, "HL3A:SBPM:HL41:PHI") field(DOL4, "HL3A:SBPM:HL41:PHI") field(DOL5, "HL3A:SBPM:HL41:PHI") field(DOL6, "HL3A:SBPM:HL41:PHI") field(DOL7, "HL3A:SBPM:HL41:PHI") field(DOL8, "HL3A:SBPM:HL41:PHI") field(DOL9, "HL3A:SBPM:HL41:PHI") field(DOLA, "HL3A:SBPM:HL41:PHI") field(LNK1, "HL3A:SBPM:HL41:PHI_SEL.A PP") field(LNK2, "HL3A:SBPM:HL41:PHI_SEL.B PP") field(LNK3, "HL3A:SBPM:HL41:PHI_SEL.C PP") field(LNK4, "HL3A:SBPM:HL41:PHI_SEL.D PP") field(LNK5, "HL3A:SBPM:HL41:PHI_SEL.E PP") field(LNK6, "HL3A:SBPM:HL41:PHI_SEL.F PP") field(LNK7, "HL3A:SBPM:HL41:PHI_SEL.G PP") field(LNK8, "HL3A:SBPM:HL41:PHI_SEL.H PP") field(LNK9, "HL3A:SBPM:HL41:PHI_SEL.I PP") field(LNKA, "HL3A:SBPM:HL41:PHI_SEL.J PP") field(SELM, "Specified") field(SELL, "HL3A:SBPM:HL41:PHI_CTRL NPP NMS") } # The $[parm]_SEL record holds all possible # values of $[parm] in the 'A..J' fields. # # When processed it updates it's own VAL # to the currently selected input. Input # 'L' serves as the (1-based) selector, # i.e., L==1 selects 'A'->'VAL'. # # When the selected value changes (as a # result of SEQ depositing a new value OR # $[ctrl] changing and updating L) then # the propagator record attached to the # FLNK is processed. # record(sub, "HL3A:SBPM:HL41:PHI_SEL") { # field(INAM, "parmSelSubInit") field(SNAM, "parmSelSubProc") field(A, "0") field(B, "0") field(C, "") field(D, "") field(E, "") field(F, "") field(G, "") field(H, "") field(I, "") field(J, "") field(PREC, "1") field(FLNK, "HL3A:SBPM:HL41:PHI_PROP") info(autosaveFields, "A B C D E F G H I J") } # # Finally the dfanout record # fetches the currently selected # value from SEL and propagates it # to $[outl]. It also updates # $[parm] itself so that $[parm] # always reflects the currently # selected value. # record(dfanout, "HL3A:SBPM:HL41:PHI_PROP") { field(OMSL, "closed_loop") field(DOL, "HL3A:SBPM:HL41:PHI_SEL") field(OUTA, "HL3A:SBPM:HL41:CALC.E CA") field(OUTB, "HL3A:SBPM:HL41:PHI PP") } # Drive the SEL record when the 'ctrl' PV changes # Use a CA link to monitor such changes record(calcout, "HL3A:SBPM:HL41:PHI_CTRL") { field(INPA, "HL3A:SBPM:HL41:PARMSEL CP") field(CALC, "A+1") field(DOPT, "Use CALC") field(OOPT, "On Change") field(OUT, "HL3A:SBPM:HL41:PHI_SEL.L PP") } # Maintain multiple (up to 10) values of # a parameter: # # Record holding the parameter $[parm] # must FLNK -> $[parm]_SEQ # # Different values of the parameter # $[parm0]..$[parm9] are stored in # $[parm]_SEL.A .. $[parm]_SEL.J # # The actual value of the parameter is # selected based on the value of a controlling # PV $[ctrl] using a 'mapping' CALC expression # $[mapc] to convert the $[ctrl] value into # the integer range 1..10. # # The selected value of $[parm] is written # to output link $[outl] # # A) When the user writes $[parm] then # its value is deposited in the currently # selected field of $[parm]_SEL and # propagated to $[outl] # # B) When the user writes any of $[parm]_SEL.A..J # then the value is stored there. If she # writes to the currently 'active' field\ # (as selected by $[ctrl]) then # the $[parm] PV itself is updated and the # value is also propagated to $[outl] # # C) If the user changes $[ctrl] then the # corresponding value $[parm]_SEL.A..J is # propagated to $[outl] and $[parm]. # # D) At initialization, the value corresponding # to the initial setting of $[ctrl] is written # to $[outl] and $[parm] # # MACROS: # # $[parm] PV holding the parameter # $[ctrl] PV that controls the selection of # the currently active setting of # $[parm] # $[outl] PV where the currently selected # value of $[parm] shall be written-to # (if applicable) # $[prec] Precision of the $[parm]_SEL variable # (should be set to same value as $[parm].PREC) # # $[parm0]..$[parm9] initial values of $[parm] # # $[mapc] CALC expression to convert the value # of the controlling PV which is available # as 'A' to the range 1..10 (or less if # less selections are used). # E.g., to convert the value of a bo (0/1) # you would set mapc to 'A+1' (0..1 -> 1..2) # # NOTE: This sb snippet is loaded/expanded # for every parameter under control # of $[ctrl]. ALSO, the companion # snippet parmCtl.db must be loaded/expanded # but only once per controlling PV. # # This record, when scanned (as a result # of $[parm] being written and processing # its FLNK to this record] fetches $[parm] # and deposits the value into the currently # selected field of the SEL record. # # NOTE: unfortunately, the selection # mechanism of the SEQ and SEL # records differs: SEQ is 1-based, # SEL is 0-based -- now that makes # sense, doesn't it? # record(seq, "HL3A:SBPM:HL41:PSI_SEQ") { field(DESC, "Propagate Parm -> SEL") field(DOL1, "HL3A:SBPM:HL41:PSI") field(DOL2, "HL3A:SBPM:HL41:PSI") field(DOL3, "HL3A:SBPM:HL41:PSI") field(DOL4, "HL3A:SBPM:HL41:PSI") field(DOL5, "HL3A:SBPM:HL41:PSI") field(DOL6, "HL3A:SBPM:HL41:PSI") field(DOL7, "HL3A:SBPM:HL41:PSI") field(DOL8, "HL3A:SBPM:HL41:PSI") field(DOL9, "HL3A:SBPM:HL41:PSI") field(DOLA, "HL3A:SBPM:HL41:PSI") field(LNK1, "HL3A:SBPM:HL41:PSI_SEL.A PP") field(LNK2, "HL3A:SBPM:HL41:PSI_SEL.B PP") field(LNK3, "HL3A:SBPM:HL41:PSI_SEL.C PP") field(LNK4, "HL3A:SBPM:HL41:PSI_SEL.D PP") field(LNK5, "HL3A:SBPM:HL41:PSI_SEL.E PP") field(LNK6, "HL3A:SBPM:HL41:PSI_SEL.F PP") field(LNK7, "HL3A:SBPM:HL41:PSI_SEL.G PP") field(LNK8, "HL3A:SBPM:HL41:PSI_SEL.H PP") field(LNK9, "HL3A:SBPM:HL41:PSI_SEL.I PP") field(LNKA, "HL3A:SBPM:HL41:PSI_SEL.J PP") field(SELM, "Specified") field(SELL, "HL3A:SBPM:HL41:PSI_CTRL NPP NMS") } # The $[parm]_SEL record holds all possible # values of $[parm] in the 'A..J' fields. # # When processed it updates it's own VAL # to the currently selected input. Input # 'L' serves as the (1-based) selector, # i.e., L==1 selects 'A'->'VAL'. # # When the selected value changes (as a # result of SEQ depositing a new value OR # $[ctrl] changing and updating L) then # the propagator record attached to the # FLNK is processed. # record(sub, "HL3A:SBPM:HL41:PSI_SEL") { # field(INAM, "parmSelSubInit") field(SNAM, "parmSelSubProc") field(A, "90") field(B, "90") field(C, "") field(D, "") field(E, "") field(F, "") field(G, "") field(H, "") field(I, "") field(J, "") field(PREC, "1") field(FLNK, "HL3A:SBPM:HL41:PSI_PROP") info(autosaveFields, "A B C D E F G H I J") } # # Finally the dfanout record # fetches the currently selected # value from SEL and propagates it # to $[outl]. It also updates # $[parm] itself so that $[parm] # always reflects the currently # selected value. # record(dfanout, "HL3A:SBPM:HL41:PSI_PROP") { field(OMSL, "closed_loop") field(DOL, "HL3A:SBPM:HL41:PSI_SEL") field(OUTA, "HL3A:SBPM:HL41:CALC.F CA") field(OUTB, "HL3A:SBPM:HL41:PSI PP") } # Drive the SEL record when the 'ctrl' PV changes # Use a CA link to monitor such changes record(calcout, "HL3A:SBPM:HL41:PSI_CTRL") { field(INPA, "HL3A:SBPM:HL41:PARMSEL CP") field(CALC, "A+1") field(DOPT, "Use CALC") field(OOPT, "On Change") field(OUT, "HL3A:SBPM:HL41:PSI_SEL.L PP") } record(longout, "HL3A:SBPM:HL41:PARMSEL") { field(VAL, "0") field(PINI, "YES") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBDEND # per BPM database for stripline BPMs ############################################## # This is the head of the main processing chain # that runs at the highest priority. ############################################## ############################################# # This is the head of the processing chain for # diagnostics. ############################################## record(ai, "HL3A:SBPM:HL42:GRN") { field(DESC, "GRN Strip Amplitude") field(DTYP, "Raw Bpm Signal") # 'card' selects PAD number, 'signal' selects strip field(INP, "#C6 S0") field(EGU, "raw") #TODO set HOPR/LOPR, alarm limits field(SCAN, "I/O Intr") # The priority determines what scan list we are being # put on (see drvPadUdpComm.c) field(PRIO, "LOW") field(FLNK, "HL3A:SBPM:HL42:RED") # HOPR for the energy algorithm is determined as follows: # # inf inf # 1) Fourier relation / h^2 dt = / |H|^2 df = 2 B # 0 -inf # # 1a) It can be shown that the maximum of the impuls response # ha is ~ 2 B # # 2) The digitizer produces the numbers # # Ai = 2^s (hi/ha) # # where ha is the maximum of the impuls response # and 2^s is a scale factor. # # 3) 'Energy algorithm' calculates S = sum( Ai^2 ) # # inf # 4) S = (2^s / ha)^2 sum(hi^2) = K sum(hi^2) Dt ~ K / h^2 dt # 0 # # with K = (2^s / ha)^2 fs # # 5) From 4) and 1a) -> S ~ K ha and therefore # # 6) S = 2^(2s) fs/ha = 2^(2s) fs/(2 B) # # 7) The strip signals are sqrt(S); hence HOPR is about # # HOPR ~ 2^s sqrt( fs/2/B ) # # with 2^s = 32768, fs=120MHz, B=10MHz it follows # that HOPR ~ 1E5; we add some margin... field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(ai, "HL3A:SBPM:HL42:RED") { field(DESC, "RED Strip Amplitude") field(DTYP, "Raw Bpm Signal") # 'card' selects PAD number, 'signal' selects strip field(INP, "#C6 S1") field(EGU, "raw") field(SCAN, "Passive") field(FLNK, "HL3A:SBPM:HL42:BLU") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(ai, "HL3A:SBPM:HL42:BLU") { field(DESC, "BLU Strip Amplitude") field(DTYP, "Raw Bpm Signal") # 'card' selects PAD number, 'signal' selects strip field(INP, "#C6 S2") field(EGU, "raw") field(SCAN, "Passive") field(FLNK, "HL3A:SBPM:HL42:YLO") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(ai, "HL3A:SBPM:HL42:YLO") { field(DESC, "YLO Strip Amplitude") field(DTYP, "Raw Bpm Signal") # 'card' selects PAD number, 'signal' selects strip field(INP, "#C6 S3") field(EGU, "raw") field(SCAN, "Passive") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } ############################################## # Slowly-scanned diagnostics ############################################## # record(waveform, "HL3A:SBPM:HL42:REDW") { field(DESC, "Raw CAL RED Data") field(DTYP, "WavBuf") # 'signal' number selects 'beam', 'calX', 'calY' field(INP, "#C6 S1") field(NELM, "512") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32768") field(LOPR, "-32767") field(SCAN, "1 second") } record(waveform, "HL3A:SBPM:HL42:GRNW") { field(DESC, "Raw CAL GRN Data") field(DTYP, "WavBuf") # 'signal' number selects 'beam', 'calX', 'calY' field(INP, "#C6 S2") field(NELM, "512") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32768") field(LOPR, "-32767") field(SCAN, "1 second") } record(waveform, "HL3A:SBPM:HL42:RAWDBG") { field(DESC, "Raw BEAM Dbg") field(DTYP, "WavBuf") # 'signal' number selects 'beam', 'calX', 'calY' # do not 'wbscan' for now since e.g., an underrange # condition on the real signal can happen. field(INP, "#C6 S7") field(NELM, "512") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32768") field(LOPR, "-32767") field(SCAN, "Passive") } record(waveform, "HL3A:SBPM:HL42:REDDBG") { field(DESC, "Raw CAL RED Dbg") field(DTYP, "WavBuf") # 'signal' number selects 'beam', 'calX', 'calY' field(INP, "#C6 S8 @wbscan") field(NELM, "512") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32768") field(LOPR, "-32767") field(SCAN, "Passive") } record(waveform, "HL3A:SBPM:HL42:GRNDBG") { field(DESC, "Raw CAL GRN Dbg") field(DTYP, "WavBuf") # 'signal' number selects 'beam', 'calX', 'calY' field(INP, "#C6 S9 @wbscan") field(NELM, "512") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32768") field(LOPR, "-32767") field(SCAN, "Passive") } record(ai, "HL3A:SBPM:HL42:GRUV") { field(DESC, "CAL Gain GRN/RED") field(DTYP, "Raw Stripl Calp") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C6 S0") field(SCAN, "10 second") field(PREC, "4") field(LOPR, "0.5") field(HOPR, "1.5") } record(ai, "HL3A:SBPM:HL42:GRU") { field(DESC, "CAL Gain GRN/BLU") field(DTYP, "Raw Stripl Calp") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C6 S1") field(SCAN, "10 second") field(PREC, "4") field(LOPR, "0.5") field(HOPR, "1.5") info(autosaveFields, "ASLO") } record(ai, "HL3A:SBPM:HL42:GRV") { field(DESC, "CAL Gain RED/YLO") field(DTYP, "Raw Stripl Calp") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C6 S2") field(SCAN, "10 second") field(PREC, "4") field(LOPR, "0.5") field(HOPR, "1.5") info(autosaveFields, "ASLO") } record(ai, "HL3A:SBPM:HL42:TGRN") { field(DESC, "Green arrival time") field(DTYP, "Raw Bpm Signal") field(EGU, "ADC Clocks") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C6 S4") field(SCAN, "10 second") field(PREC, "1") field(LOPR, "0") field(HOPR, "128") field(LOLO, "5") field(LOW, "8") field(HIGH, "60") field(HIHI, "70") field(LLSV, "MAJOR") field(LSV, "MINOR") field(HSV, "MINOR") field(HHSV, "MAJOR") } record(ai, "HL3A:SBPM:HL42:TRED") { field(DESC, "Red arrival time") field(DTYP, "Raw Bpm Signal") field(EGU, "ADC Clocks") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C6 S5") field(SCAN, "10 second") field(PREC, "1") field(LOPR, "0") field(HOPR, "128") field(LOLO, "5") field(LOW, "8") field(HIGH, "60") field(HIHI, "70") field(LLSV, "MAJOR") field(LSV, "MINOR") field(HSV, "MINOR") field(HHSV, "MAJOR") } record(ai, "HL3A:SBPM:HL42:TBLU") { field(DESC, "Blue arrival time") field(DTYP, "Raw Bpm Signal") field(EGU, "ADC Clocks") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C6 S6") field(SCAN, "10 second") field(PREC, "1") field(LOPR, "0") field(HOPR, "128") field(LOLO, "5") field(LOW, "8") field(HIGH, "60") field(HIHI, "70") field(LLSV, "MAJOR") field(LSV, "MINOR") field(HSV, "MINOR") field(HHSV, "MAJOR") } record(ai, "HL3A:SBPM:HL42:TYLO") { field(DESC, "Yellow arrival time") field(DTYP, "Raw Bpm Signal") field(EGU, "ADC Clocks") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C6 S7") field(SCAN, "10 second") field(PREC, "1") field(LOPR, "0") field(HOPR, "128") field(LOLO, "5") field(LOW, "8") field(HIGH, "60") field(HIHI, "70") field(LLSV, "MAJOR") field(LSV, "MINOR") field(HSV, "MINOR") field(HHSV, "MAJOR") } record(ao, "HL3A:SBPM:HL42:PINC_ADJ") { field(DESC, "Adjust Pinc. Corr.") field(DTYP, "Soft Channel") field(OUT, "HL3A:SBPM:HL42:CALC.K PP MS") field(VAL, "0") field(DRVL, "0") field(DRVH, "2") field(PINI, "YES") info(autosaveFields, "VAL") } # QSCL setting: # # Q: charge # Z: impedance # F: form factor: phi/(2 pi) sin(2 pi f l/c) # # Signal = Q Z F G h(t) = A h(t) [A] = Vs # # inf inf # Energy = A^2 / h^2(t) dt = A^2 / |H(w)|^2 dw/2/pi = A^2 B # 0 0 # # Measured energy = Sum{ (Vp/32768 * xi)^2 } / fs = S / fs ~ Energy # # -> A^2 B = S/fs # # With T = sqrt( Sum{ xi^2 } ) # # A = sqrt(S)/sqrt(B*fs) = T/sqrt(B*fs) Vp/32768 # # T/32768 Vp # Q = A/F/G/Z = ----------------- # F G Z sqrt(B*fs) # # Vp = { 1.5Vpp/2 (PGA=1) or 2.25Vpp/2 (PGA=0) } / 2 (transformer) # # I believe PGA is off (-> Vp ~ .56V) # # Z = 50 # # G: (calibration uses GRN/BLU -> signal should have the # level of the grn/red channels with the additional switch) # # Block diagram / parts / gain: # # [filt] [Att1] [Amp1] [Att2] [BPF] [Amp2] [pad] [Amp3] [switch] # f-17520 hmc540lp3 SBF-5089 hmc540lp3 MBP-140-6-4 SBF-4089 PAT-0 SBF-4089 HMC-197 # # -2dB* -1dB 20dB -1dB -4.5 14.8dB 0dB 14.8dB -0.4dB # # *: 1st filter ATT is a wild guess. # BPF loss (RLC Catalog, pp.55): (L (nsect+.5) / (% of 3dB BW) + .2) dB # with L ~6.2 10MHz/fc=140Mhz filter-> 4.5 # # -> Gtot ~ 40.7dB # # subtract cable loss (2dB); Gtot = 86 # # T/32768 Vp .56V/32768 # Q = A/F/G/Z = ----------------- = T/F ------------------------ # F G Z sqrt(B*fs) 86*50*sqrt(10*140)Mhz # # = T/F = 1.06E-7/F nC # # F for a 7% coverage, 4" BPM at 140MHz .07 sin(2*pi*140e6 4*.0254/3e8) # = .021 # # => 1.06E-7/.021 nC = 5E-6 nC # # (Faraday cup measurement -> (3600/44)^-1 1e-4 -> 1.22E-6 # record(ao, "HL3A:SBPM:HL42:QSCL") { field(DESC, "TMIT/Charge Scale") field(DTYP, "Soft Channel") field(OUT, "HL3A:SBPM:HL42:QSCA.A PP MS") # 5.0E-6 / 1.6E-10 [nC/e-] field(VAL, "31250") field(EGU, "Nel") field(PREC, "3") field(PINI, "YES") info(autosaveFields, "VAL") } # Adjust TMIT scale for AFE attenuation record(calcout, "HL3A:SBPM:HL42:QSCA") { field(DESC, "TMIT ATT Adj. Scale") field(INPB, "HL3A:SBPM:HL42:ATT1 CP") field(INPC, "HL3A:SBPM:HL42:ATT2 CP") field(CALC, "A*10^((B+C+D)/20)") # use CA link to deposit into TMIT.ASLO so # that TMIT is not forced into linkset # of this record field(OUT, "HL3A:SBPM:HL42:TMIT.ASLO CA") field(EGU, "Nel") field(PREC, "3") info(autosaveFields, "D") } record(ao, "HL3A:SBPM:HL42:ATT1SIMP") { field(DESC, "ATT1 Propagator") field(DTYP, "Soft Channel") field(DOL, "HL3A:SBPM:HL42:ATT1 CP") field(OMSL, "closed_loop") field(OUT, "HL3A:SBPM:HL42:ASIM.A PP") field(IVOA, "Set output to IVOV") field(IVOV, "0") field(EGU, "dB") } record(ao, "HL3A:SBPM:HL42:ATT2SIMP") { field(DESC, "ATT2 Propagator") field(DTYP, "Soft Channel") field(DOL, "HL3A:SBPM:HL42:ATT2 CP") field(OMSL, "closed_loop") field(OUT, "HL3A:SBPM:HL42:ASIM.C PP") field(IVOA, "Set output to IVOV") field(IVOV, "0") field(EGU, "dB") } # Attenuate charge either by # real attenuator settings or # by fake ones. # If B, C >= 0 then their # values will be used instead # of ATT1, ATT2 record(calcout, "HL3A:SBPM:HL42:ASIM") { field(DESC, "Q Simul Attenuator") field(DTYP, "Soft Channel") field(OUT, "HL3A:SBPM:HL42:QSIM.ESLO PP") # ATT1SIM puts value into A # set to -1 to use real attenuator settings # and >=0 to use B instead field(B, "-1") # ATT2SIM puts value into C # set to -1 to use real attenuator settings # and >=0 to use D instead field(D, "-1") field(CALC, "10^(((B>=0?B:A)+(D>=0?D:C))/20)") field(PINI, "YES") } record(ao, "HL3A:SBPM:HL42:WSIM") { field(DESC, "BPM W Simul.") field(DTYP, "Soft Channel") field(OUT, "HL3A:SBPM:HL42:SIM.G PP") field(VAL, "0.07") field(EGU, "%") field(PINI, "YES") field(PREC, "3") field(LOPR, "0") field(HOPR, "0.25") } record(sel, "HL3A:SBPM:HL42:STA") { field(DESC, "Status Summary") field(SELM, "High Signal") field(INPA, "HL3A:SBPM:HL42:RSTA.SEVR MS NPP") field(INPB, "HL3A:SBPM:HL42:TMIT.SEVR MS NPP") field(INPC, "HL3A:SBPM:HL42:Y.SEVR MS NPP") field(INPD, "HL3A:SBPM:HL42:X.SEVR MS NPP") field(INPE, "HL3A:SBPM:HL42:TGRN.SEVR MS NPP") field(INPF, "HL3A:SBPM:HL42:TRED.SEVR MS NPP") field(INPG, "HL3A:SBPM:HL42:TBLU.SEVR MS NPP") field(INPH, "HL3A:SBPM:HL42:TYLO.SEVR MS NPP") field(INPI, "HL3A:SBPM:HL42:GRU.SEVR MS NPP") field(INPJ, "HL3A:SBPM:HL42:GRV.SEVR MS NPP") field(SCAN, "1 second") } # This record really belongs on the # PAD IOC. We keep them here however # so we can save/restore. It is more # confusing but shouldn't matter from # an efficiency standpoint (they are # rarely changed). record(longout, "HL3A:SBPM:HL42:ATTO") { field(DESC, "AFE Tot. Att. Offset") # fetched via inlink #field(OUT, "HL3A:SBPM:HL42:ATTC.B PP") field(DRVL, "-10") field(DRVH, "30") field(LOPR, "-10") field(HOPR, "30") field(EGU, "dB") field(VAL, "0") field(PINI, "YES") info(autosaveFields, "VAL DRVH HOPR DRVL LOPR") } # This record really belongs on the # PAD IOC. We keep them here however # so we can save/restore. It is more # confusing but shouldn't matter from # an efficiency standpoint (they are # rarely changed). record(longout, "HL3A:SBPM:HL42:CLAO") { field(DESC, "AFE Cal. Att. Offset") # fetched via inlink #field(OUT, "HL3A:SBPM:HL42:ATTC.C PP") field(DRVL, "-20") field(DRVH, "20") field(LOPR, "-20") field(HOPR, "20") field(EGU, "dB") field(VAL, "40") field(PINI, "YES") info(autosaveFields, "VAL DRVH HOPR DRVL LOPR") } record(calc, "HL3A:SBPM:HL42:STA_ALH") { field(DESC, "Status Summary") field(SCAN, "1 second") field(CALC, "0") field(INPA, "HL3A:SBPM:HL42:RSTA_ALH.SEVR MS NPP") field(INPB, "HL3A:SBPM:HL42:GRU.SEVR MS NPP") field(INPC, "HL3A:SBPM:HL42:GRV.SEVR MS NPP") field(INPD, "HL3A:SBPM:HL42:CHK.SEVR MS NPP") field(INPE, "") field(INPF, "HL3A:SBPM:HL42:AFE_COMM.SEVR MS NPP") } # snapshot PV for the bpm values display record(ai, "HL3A:SBPM:HL42:GRN_SLOW") { field(DESC, "GRN snapshot for display") field(INP, "HL3A:SBPM:HL42:GRN NPP MS") field(EGU, "raw") field(SCAN, "1 second") field(FLNK, "HL3A:SBPM:HL42:RED_SLOW") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(ai, "HL3A:SBPM:HL42:RED_SLOW") { field(DESC, "RED snapshot for display") # 'card' selects PAD number, 'signal' selects strip field(INP, "HL3A:SBPM:HL42:RED NPP MS") field(EGU, "raw") field(SCAN, "Passive") field(FLNK, "HL3A:SBPM:HL42:BLU_SLOW") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(ai, "HL3A:SBPM:HL42:BLU_SLOW") { field(DESC, "BLU snapshot for display") # 'card' selects PAD number, 'signal' selects strip field(INP, "HL3A:SBPM:HL42:BLU NPP MS") field(EGU, "raw") field(SCAN, "Passive") field(FLNK, "HL3A:SBPM:HL42:YLO_SLOW") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(ai, "HL3A:SBPM:HL42:YLO_SLOW") { field(DESC, "YLO snapshot for display") field(INP, "HL3A:SBPM:HL42:YLO NPP MS") field(EGU, "raw") field(SCAN, "Passive") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(sub, "HL3A:SBPM:HL42:CALC") { field(SNAM, "drvBpmBvectSetupSub") # E: phi F: psi # BPM channel number in L field(INPL, "6") field(SCAN, "Passive") } record(bo, "HL3A:SBPM:HL42:PINC_ENA") { field(DESC, "Simple Pincushion Alg") field(DTYP, "BusAddress") field(OUT, "#C0S2@drvBpmStriplPincEna,m32") field(MASK, "64") field(ZNAM, "DISABLED") field(ONAM, "ENABLED") field(VAL, "0") field(PINI, "YES") info(autosaveFields, "VAL") } record(ao, "HL3A:SBPM:HL42:UDR_THRES") { field(DESC, "Detection Underrange Threshold") field(DTYP, "Bpm Parameters") field(OUT, "#C6S0") field(EGU, "ADC Ticks") field(DOL, "45.26") field(PINI, "YES") field(DRVL, "0") field(DRVH, "32767") info(autosaveFields, "VAL") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBDEND # per BPM database for stripline BPMs ###################################### # HEAD of main processing chain ###################################### record(ai, "HL3A:SBPM:HL42:X") { field(DESC, "X Position") field(EGU, "mm") field(DTYP, "Raw Bpm Signal") field(INP, "#C6 S11") field(SCAN, "I/O Intr") # The priority determines what scan list we are being # put on (see drvPadUdpComm.c) field(PRIO, "HIGH") field(FLNK, "HL3A:SBPM:HL42:Y") field(PREC, "4") field(LOPR, "-12") field(HOPR, "+12") field(ASG, "") field(TSE, "-2") info(autosaveFields, "ASLO LOLO LOW HIGH HIHI HHSV LLSV") } record(ai, "HL3A:SBPM:HL42:Y") { field(DESC, "Y Position") field(EGU, "mm") field(DTYP, "Raw Bpm Signal") field(INP, "#C6 S12") field(FLNK, "HL3A:SBPM:HL42:TMIT") field(PREC, "4") field(LOPR, "-12") field(HOPR, "+12") field(ASG, "") field(TSE, "-2") info(autosaveFields, "ASLO LOLO LOW HIGH HIHI HHSV LLSV") } record(ai, "HL3A:SBPM:HL42:TMIT") { field(DESC, "Charge Estimate") field(DTYP, "Raw Bpm Signal") field(INP, "#C6 S13") field(EGU, "Nel") field(PREC, "3") field(LOPR, "0") field(HOPR, "1E11") # FLINK into BSA field(FLNK, "HL3A:SBPM:HL42:EFX.PROC") field(ASG, "") field(TSE, "-2") info(autosaveFields, "LOLO LOW HIGH HIHI HHSV LLSV ") } ###################################### # HEAD of diagnostics processing chain ###################################### # leave RWAV in it's own lockset; don't FLNK # to 'U' & friends record(waveform, "HL3A:SBPM:HL42:RWAV") { field(DESC, "Raw BPM Data") field(DTYP, "WavBuf") # 'signal' number selects 'beam', 'calX', 'calY' field(INP, "#C6 S0") field(SCAN, "I/O Intr") # use LOW or HIGH to end up on the 'diagnostic' # scan list (see drvPadUdpComm.c) field(PRIO, "LOW") field(NELM, "512") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32768") field(LOPR, "-32767") } record(ai, "HL3A:SBPM:HL42:U") { field(DESC, "Raw U Position") field(DTYP, "Raw Bpm Signal") field(INP, "#C6 S8") field(SCAN, "I/O Intr") # use LOW or HIGH to end up on the 'diagnostic' # scan list (see drvPadUdpComm.c) field(PRIO, "LOW") field(PREC, "5") field(EGU, "mm") field(LOPR, "-0.7") field(HOPR, "+0.7") field(FLNK, "HL3A:SBPM:HL42:V") } record(ai, "HL3A:SBPM:HL42:V") { field(DESC, "Raw V Position") field(DTYP, "Raw Bpm Signal") field(INP, "#C6 S9") field(SCAN, "Passive") field(PREC, "5") field(EGU, "mm") field(LOPR, "-0.7") field(HOPR, "+0.7") field(FLNK, "HL3A:SBPM:HL42:PINC") } record(ai, "HL3A:SBPM:HL42:PINC") { field(DESC, "Pin Cushion Corr.") field(DTYP, "Raw Bpm Signal") field(INP, "#C6 S10") field(SCAN, "Passive") } record(longin, "HL3A:SBPM:HL42:RSTA") { field(DESC, "Status of Raw Processor") field(DTYP, "Bpm Raw Status") field(INP, "#C6S0") field(SCAN, "1 second") field(LOLO, "-1") field(HIHI, "+1") field(HHSV, "INVALID") field(LLSV, "INVALID") field(FLNK, "HL3A:SBPM:HL42:RSTA_ALH") } record(calc, "HL3A:SBPM:HL42:RSTA_ALH") { field(CALC, "A & B") field(INPA, "HL3A:SBPM:HL42:RSTA") field(INPB, "0x30F") field(HIHI, "1") field(LOLO, "-1") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(SCAN, "Passive") } ###################################### # Input/Parameteres ###################################### record(ao, "HL3A:SBPM:HL42:PHI") { field(DESC, "Rot Angle") field(DTYP, "Soft Channel") field(VAL, "0") field(EGU, "deg") field(PREC, "1") field(LOPR, "-180") field(HOPR, "+180") field(FLNK, "HL3A:SBPM:HL42:PHI_SEQ") } record(ao, "HL3A:SBPM:HL42:PSI") { field(DESC, "Axis Sep. Angle") field(DTYP, "Soft Channel") field(VAL, "90") field(EGU, "deg") field(PREC, "1") field(LOPR, "0") field(HOPR, "+180") field(FLNK, "HL3A:SBPM:HL42:PSI_SEQ") } #record(dfanout, "HL3A:SBPM:HL42:PCMM") { # field(DESC, "BPM Scale") # field(OUTA, "HL3A:SBPM:HL42:USCL PP MS") # field(OUTB, "HL3A:SBPM:HL42:VSCL PP MS") # field(VAL, "12") # field(EGU, "mm") # field(PREC, "4") # field(LOPR, "5") # field(HOPR, "15") # field(PINI, "YES") #} record(ao, "HL3A:SBPM:HL42:UOFF") { field(DESC, "BPM U Offset") field(DTYP, "Soft Channel") field(VAL, "0") field(EGU, "mm") field(PREC, "4") field(LOPR, "-5") field(HOPR, "+5") field(FLNK, "HL3A:SBPM:HL42:UOFF_SEQ") } record(ao, "HL3A:SBPM:HL42:VOFF") { field(DESC, "BPM V Offset") field(DTYP, "Soft Channel") field(VAL, "0") field(EGU, "mm") field(PREC, "4") field(LOPR, "-5") field(HOPR, "+5") field(FLNK, "HL3A:SBPM:HL42:VOFF_SEQ") } record(ao, "HL3A:SBPM:HL42:USCL") { field(DESC, "BPM U Scale") field(DTYP, "Soft Channel") field(VAL, "1") field(EGU, "mm") field(PREC, "4") field(FLNK, "HL3A:SBPM:HL42:USCL_SEQ") } record(ao, "HL3A:SBPM:HL42:VSCL") { field(DESC, "BPM V Scale") field(DTYP, "Soft Channel") field(VAL, "1") field(EGU, "mm") field(PREC, "4") field(FLNK, "HL3A:SBPM:HL42:VSCL_SEQ") } record(mbbo, "HL3A:SBPM:HL42:ACCESS") { field(DESC, "BPM On Line") field(DTYP, "StreamSwitch") field(OUT, "#C6 S0") field(ZRVL, "1") field(ZRST, "Running") field(ZRSV, "NO_ALARM") field(ONVL, "1") field(ONST, "Maintenance") field(ONSV, "MINOR") field(TWVL, "1") field(TWST, "Test") field(TWSV, "MINOR") field(THVL, "0") field(THST, "OFFLINE") field(THSV, "MAJOR") # set both, rval and val to get it right # regardless of whether devsup does conversion # or not. field(RVAL, "0") field(VAL, "0") field(PINI, "YES") field(FLNK, "HL3A:SBPM:HL42:SIMOFF") info(autosaveFields, "RVAL") } # # 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, "HL3A:SBPM:HL42:FBCK") { field(DESC, "Feedback State") field(PINI, "YES") field(OMSL, "supervisory") field(VAL, "0") field(ZRVL, "0") field(ONVL, "1") field(TWVL, "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") info(autosaveFields, "VAL") } # Convenience record holding the MAD name record(stringin, "HL3A:SBPM:HL42:MADN") { field(DESC, "MAD Name") field(VAL, "SBPMHL42") field(PINI, "YES") } record(stringin, "SBPMHL42:NAME") { field(DESC, "BPM Name") field(VAL, "HL3A:SBPM:HL42") field(PINI, "YES") } record(ai, "HL3A:SBPM:HL42:X_SLOW") { #alias("HL3A:SBPM:HL42:X1H") field(DESC, "X snapshot for display") field(EGU, "mm") field(INP, "HL3A:SBPM:HL42:X MS") field(FLNK, "HL3A:SBPM:HL42:Y_SLOW") field(PREC, "4") field(SCAN, "1 second") field(LOPR, "-12") field(HOPR, "+12") } record(ai, "HL3A:SBPM:HL42:Y_SLOW") { #alias("HL3A:SBPM:HL42:Y1H") field(DESC, "Y snapshot for display") field(EGU, "mm") field(INP, "HL3A:SBPM:HL42:Y NPP MS") field(FLNK, "HL3A:SBPM:HL42:TMIT_SLOW") field(PREC, "4") field(LOPR, "-12") field(HOPR, "+12") } record(ai, "HL3A:SBPM:HL42:TMIT_SLOW") { #alias("HL3A:SBPM:HL42:TMIT1H") field(DESC, "TMIT snapshot for display") field(INP, "HL3A:SBPM:HL42:TMIT NPP MS") field(EGU, "Nel") field(PREC, "3") field(LOPR, "0") field(HOPR, "1E11") } ###################################### # Simulation Parameters + Control ###################################### # switch off simulation when going off-line record(calcout, "HL3A:SBPM:HL42:SIMOFF") { field(DESC, "Sim Off Propagator") field(INPA, "HL3A:SBPM:HL42:ACCESS.RVAL") field(CALC, "A") field(OCAL, "0") field(OOPT, "When Zero") field(DOPT, "Use OCAL") field(OUT, "HL3A:SBPM:HL42:SIMC PP") } record(calcout, "HL3A:SBPM:HL42:SIM") { field(DESC, "BPM Pos. Simulation") field(DTYP, "Strip Signal Simulator") field(OUT, "6") #CALC & VAL unused; the real calculation is done # in device support. The reason this is a # calcout rather than sub is that we want # to use the OUT link... field(CALC, "A") field(INPA, "HL3A:SBPM:HL42:USCL") field(INPL, "0") } # Switch simulation record HL3A:SBPM:HL42:SIMCSEQ moved to # bpmCavity.db.part and bpmStripl.db.part record(mbbo, "HL3A:SBPM:HL42:SIMC") { field(DESC, "Stripl Sim Ctl") field(DTYP, "Raw Soft Channel") field(OUT, "HL3A:SBPM:HL42:SIMCSEQ.SELN PP") field(ZRST, "OFF") field(ZRVL, "0x0f") field(ONST, "ON") field(ONVL, "0x1c0") field(TWST, "SOFT") field(TWVL, "0x030") field(MASK, "-1") field(NOBT, "16") field(VAL, "0") field(RVAL, "0x0f") field(PINI, "YES") } record(ao, "HL3A:SBPM:HL42:XSIM") { field(DESC, "BPM X Pos. Simul.") field(DTYP, "Soft Channel") field(OUT, "HL3A:SBPM:HL42:SIM.B PP") field(VAL, "0.5") field(EGU, "mm") field(PINI, "YES") field(PREC, "4") field(LOPR, "-12") field(HOPR, "+12") } record(ao, "HL3A:SBPM:HL42:YSIM") { field(DESC, "BPM Y Pos. Simul.") field(DTYP, "Soft Channel") field(OUT, "HL3A:SBPM:HL42:SIM.C PP") field(VAL, "0.") field(EGU, "mm") field(PINI, "YES") field(PREC, "4") field(LOPR, "-12") field(HOPR, "+12") } record(ao, "HL3A:SBPM:HL42:QSIM") { field(DESC, "BPM Q Simul.") field(DTYP, "Raw Soft Channel") field(OUT, "HL3A:SBPM:HL42:SIM.D PP") field(EGU, "Nel") field(ASLO, "6000") #ESLO is used to add attenuation field(LINR, "LINEAR") field(VAL, "1E9") field(PINI, "YES") field(PREC, "4") field(LOPR, "0") field(HOPR, "1E11") } record(ao, "HL3A:SBPM:HL42:ROTS") { field(DESC, "BPM Rot. Simul.") field(DTYP, "Soft Channel") field(OUT, "HL3A:SBPM:HL42:SIM.E PP") field(VAL, "0.") field(EGU, "deg") field(PINI, "YES") field(PREC, "1") field(LOPR, "-180") } record(ao, "HL3A:SBPM:HL42:PSIS") { field(DESC, "BPM Angle. Simul.") field(DTYP, "Soft Channel") field(OUT, "HL3A:SBPM:HL42:SIM.F PP") field(VAL, "90") field(EGU, "deg") field(PINI, "YES") field(PREC, "1") field(LOPR, "0") } record(aao, "HL3A:SBPM:HL42:DIGISIMW") { field(DESC, "VME Digi Sim. Waveform") field(DTYP, "VmeDigi Sim Wav") field(OUT, "#C6 S0") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32678") field(LOPR, "-32768") # 16384 samples/channel * 4 channels field(NELM, "65536") field(PINI, "NO") } #Used by model/database folks to verify BPM record(ao, "HL3A:SBPM:HL42:Z") { field(DESC, "Z Position") field(PINI, "YES") info(autosaveFields, "VAL") } # MPS interface record(bo, "HL3A:SBPM:HL42:MPSBYP") { field(DESC, "MPS Bypass") field(DTYP, "BusAddress") field(OUT, "#C0S2@bpmMPS+0,m32") field(MASK, "64") field(ZNAM, "BYPASSED") field(ONAM, "NOT_BYPASSED") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(VAL, "0") field(PINI, "YES") field(ASG, "") info(autosaveFields, "VAL") } record(bo, "HL3A:SBPM:HL42:MPSLTBYP") { field(DESC, "MPS Bypass") field(DTYP, "BusAddress") field(OUT, "#C1S2@bpmMPS+0,m32") field(MASK, "64") field(ZNAM, "BYPASSED") field(ONAM, "NOT_BYPASSED") field(ZSV, "NO_ALARM") field(OSV, "NO_ALARM") field(VAL, "0") field(PINI, "YES") field(ASG, "") info(autosaveFields, "VAL") } record(calc, "HL3A:SBPM:HL42:MPSIGNRCALC") { field(DESC, "MPS ignore if TMIT too low") field(CALC, "A $[parm]_SEQ # # Different values of the parameter # $[parm0]..$[parm9] are stored in # $[parm]_SEL.A .. $[parm]_SEL.J # # The actual value of the parameter is # selected based on the value of a controlling # PV $[ctrl] using a 'mapping' CALC expression # $[mapc] to convert the $[ctrl] value into # the integer range 1..10. # # The selected value of $[parm] is written # to output link $[outl] # # A) When the user writes $[parm] then # its value is deposited in the currently # selected field of $[parm]_SEL and # propagated to $[outl] # # B) When the user writes any of $[parm]_SEL.A..J # then the value is stored there. If she # writes to the currently 'active' field\ # (as selected by $[ctrl]) then # the $[parm] PV itself is updated and the # value is also propagated to $[outl] # # C) If the user changes $[ctrl] then the # corresponding value $[parm]_SEL.A..J is # propagated to $[outl] and $[parm]. # # D) At initialization, the value corresponding # to the initial setting of $[ctrl] is written # to $[outl] and $[parm] # # MACROS: # # $[parm] PV holding the parameter # $[ctrl] PV that controls the selection of # the currently active setting of # $[parm] # $[outl] PV where the currently selected # value of $[parm] shall be written-to # (if applicable) # $[prec] Precision of the $[parm]_SEL variable # (should be set to same value as $[parm].PREC) # # $[parm0]..$[parm9] initial values of $[parm] # # $[mapc] CALC expression to convert the value # of the controlling PV which is available # as 'A' to the range 1..10 (or less if # less selections are used). # E.g., to convert the value of a bo (0/1) # you would set mapc to 'A+1' (0..1 -> 1..2) # # NOTE: This sb snippet is loaded/expanded # for every parameter under control # of $[ctrl]. ALSO, the companion # snippet parmCtl.db must be loaded/expanded # but only once per controlling PV. # # This record, when scanned (as a result # of $[parm] being written and processing # its FLNK to this record] fetches $[parm] # and deposits the value into the currently # selected field of the SEL record. # # NOTE: unfortunately, the selection # mechanism of the SEQ and SEL # records differs: SEQ is 1-based, # SEL is 0-based -- now that makes # sense, doesn't it? # record(seq, "HL3A:SBPM:HL42:UOFF_SEQ") { field(DESC, "Propagate Parm -> SEL") field(DOL1, "HL3A:SBPM:HL42:UOFF") field(DOL2, "HL3A:SBPM:HL42:UOFF") field(DOL3, "HL3A:SBPM:HL42:UOFF") field(DOL4, "HL3A:SBPM:HL42:UOFF") field(DOL5, "HL3A:SBPM:HL42:UOFF") field(DOL6, "HL3A:SBPM:HL42:UOFF") field(DOL7, "HL3A:SBPM:HL42:UOFF") field(DOL8, "HL3A:SBPM:HL42:UOFF") field(DOL9, "HL3A:SBPM:HL42:UOFF") field(DOLA, "HL3A:SBPM:HL42:UOFF") field(LNK1, "HL3A:SBPM:HL42:UOFF_SEL.A PP") field(LNK2, "HL3A:SBPM:HL42:UOFF_SEL.B PP") field(LNK3, "HL3A:SBPM:HL42:UOFF_SEL.C PP") field(LNK4, "HL3A:SBPM:HL42:UOFF_SEL.D PP") field(LNK5, "HL3A:SBPM:HL42:UOFF_SEL.E PP") field(LNK6, "HL3A:SBPM:HL42:UOFF_SEL.F PP") field(LNK7, "HL3A:SBPM:HL42:UOFF_SEL.G PP") field(LNK8, "HL3A:SBPM:HL42:UOFF_SEL.H PP") field(LNK9, "HL3A:SBPM:HL42:UOFF_SEL.I PP") field(LNKA, "HL3A:SBPM:HL42:UOFF_SEL.J PP") field(SELM, "Specified") field(SELL, "HL3A:SBPM:HL42:UOFF_CTRL NPP NMS") } # The $[parm]_SEL record holds all possible # values of $[parm] in the 'A..J' fields. # # When processed it updates it's own VAL # to the currently selected input. Input # 'L' serves as the (1-based) selector, # i.e., L==1 selects 'A'->'VAL'. # # When the selected value changes (as a # result of SEQ depositing a new value OR # $[ctrl] changing and updating L) then # the propagator record attached to the # FLNK is processed. # record(sub, "HL3A:SBPM:HL42:UOFF_SEL") { # field(INAM, "parmSelSubInit") field(SNAM, "parmSelSubProc") field(A, "0") field(B, "0") field(C, "") field(D, "") field(E, "") field(F, "") field(G, "") field(H, "") field(I, "") field(J, "") field(PREC, "4") field(FLNK, "HL3A:SBPM:HL42:UOFF_PROP") info(autosaveFields, "A B C D E F G H I J") } # # Finally the dfanout record # fetches the currently selected # value from SEL and propagates it # to $[outl]. It also updates # $[parm] itself so that $[parm] # always reflects the currently # selected value. # record(dfanout, "HL3A:SBPM:HL42:UOFF_PROP") { field(OMSL, "closed_loop") field(DOL, "HL3A:SBPM:HL42:UOFF_SEL") field(OUTA, "HL3A:SBPM:HL42:U.AOFF CA") field(OUTB, "HL3A:SBPM:HL42:UOFF PP") } # Drive the SEL record when the 'ctrl' PV changes # Use a CA link to monitor such changes record(calcout, "HL3A:SBPM:HL42:UOFF_CTRL") { field(INPA, "HL3A:SBPM:HL42:PARMSEL CP") field(CALC, "A+1") field(DOPT, "Use CALC") field(OOPT, "On Change") field(OUT, "HL3A:SBPM:HL42:UOFF_SEL.L PP") } # Maintain multiple (up to 10) values of # a parameter: # # Record holding the parameter $[parm] # must FLNK -> $[parm]_SEQ # # Different values of the parameter # $[parm0]..$[parm9] are stored in # $[parm]_SEL.A .. $[parm]_SEL.J # # The actual value of the parameter is # selected based on the value of a controlling # PV $[ctrl] using a 'mapping' CALC expression # $[mapc] to convert the $[ctrl] value into # the integer range 1..10. # # The selected value of $[parm] is written # to output link $[outl] # # A) When the user writes $[parm] then # its value is deposited in the currently # selected field of $[parm]_SEL and # propagated to $[outl] # # B) When the user writes any of $[parm]_SEL.A..J # then the value is stored there. If she # writes to the currently 'active' field\ # (as selected by $[ctrl]) then # the $[parm] PV itself is updated and the # value is also propagated to $[outl] # # C) If the user changes $[ctrl] then the # corresponding value $[parm]_SEL.A..J is # propagated to $[outl] and $[parm]. # # D) At initialization, the value corresponding # to the initial setting of $[ctrl] is written # to $[outl] and $[parm] # # MACROS: # # $[parm] PV holding the parameter # $[ctrl] PV that controls the selection of # the currently active setting of # $[parm] # $[outl] PV where the currently selected # value of $[parm] shall be written-to # (if applicable) # $[prec] Precision of the $[parm]_SEL variable # (should be set to same value as $[parm].PREC) # # $[parm0]..$[parm9] initial values of $[parm] # # $[mapc] CALC expression to convert the value # of the controlling PV which is available # as 'A' to the range 1..10 (or less if # less selections are used). # E.g., to convert the value of a bo (0/1) # you would set mapc to 'A+1' (0..1 -> 1..2) # # NOTE: This sb snippet is loaded/expanded # for every parameter under control # of $[ctrl]. ALSO, the companion # snippet parmCtl.db must be loaded/expanded # but only once per controlling PV. # # This record, when scanned (as a result # of $[parm] being written and processing # its FLNK to this record] fetches $[parm] # and deposits the value into the currently # selected field of the SEL record. # # NOTE: unfortunately, the selection # mechanism of the SEQ and SEL # records differs: SEQ is 1-based, # SEL is 0-based -- now that makes # sense, doesn't it? # record(seq, "HL3A:SBPM:HL42:VOFF_SEQ") { field(DESC, "Propagate Parm -> SEL") field(DOL1, "HL3A:SBPM:HL42:VOFF") field(DOL2, "HL3A:SBPM:HL42:VOFF") field(DOL3, "HL3A:SBPM:HL42:VOFF") field(DOL4, "HL3A:SBPM:HL42:VOFF") field(DOL5, "HL3A:SBPM:HL42:VOFF") field(DOL6, "HL3A:SBPM:HL42:VOFF") field(DOL7, "HL3A:SBPM:HL42:VOFF") field(DOL8, "HL3A:SBPM:HL42:VOFF") field(DOL9, "HL3A:SBPM:HL42:VOFF") field(DOLA, "HL3A:SBPM:HL42:VOFF") field(LNK1, "HL3A:SBPM:HL42:VOFF_SEL.A PP") field(LNK2, "HL3A:SBPM:HL42:VOFF_SEL.B PP") field(LNK3, "HL3A:SBPM:HL42:VOFF_SEL.C PP") field(LNK4, "HL3A:SBPM:HL42:VOFF_SEL.D PP") field(LNK5, "HL3A:SBPM:HL42:VOFF_SEL.E PP") field(LNK6, "HL3A:SBPM:HL42:VOFF_SEL.F PP") field(LNK7, "HL3A:SBPM:HL42:VOFF_SEL.G PP") field(LNK8, "HL3A:SBPM:HL42:VOFF_SEL.H PP") field(LNK9, "HL3A:SBPM:HL42:VOFF_SEL.I PP") field(LNKA, "HL3A:SBPM:HL42:VOFF_SEL.J PP") field(SELM, "Specified") field(SELL, "HL3A:SBPM:HL42:VOFF_CTRL NPP NMS") } # The $[parm]_SEL record holds all possible # values of $[parm] in the 'A..J' fields. # # When processed it updates it's own VAL # to the currently selected input. Input # 'L' serves as the (1-based) selector, # i.e., L==1 selects 'A'->'VAL'. # # When the selected value changes (as a # result of SEQ depositing a new value OR # $[ctrl] changing and updating L) then # the propagator record attached to the # FLNK is processed. # record(sub, "HL3A:SBPM:HL42:VOFF_SEL") { # field(INAM, "parmSelSubInit") field(SNAM, "parmSelSubProc") field(A, "0") field(B, "0") field(C, "") field(D, "") field(E, "") field(F, "") field(G, "") field(H, "") field(I, "") field(J, "") field(PREC, "4") field(FLNK, "HL3A:SBPM:HL42:VOFF_PROP") info(autosaveFields, "A B C D E F G H I J") } # # Finally the dfanout record # fetches the currently selected # value from SEL and propagates it # to $[outl]. It also updates # $[parm] itself so that $[parm] # always reflects the currently # selected value. # record(dfanout, "HL3A:SBPM:HL42:VOFF_PROP") { field(OMSL, "closed_loop") field(DOL, "HL3A:SBPM:HL42:VOFF_SEL") field(OUTA, "HL3A:SBPM:HL42:V.AOFF CA") field(OUTB, "HL3A:SBPM:HL42:VOFF PP") } # Drive the SEL record when the 'ctrl' PV changes # Use a CA link to monitor such changes record(calcout, "HL3A:SBPM:HL42:VOFF_CTRL") { field(INPA, "HL3A:SBPM:HL42:PARMSEL CP") field(CALC, "A+1") field(DOPT, "Use CALC") field(OOPT, "On Change") field(OUT, "HL3A:SBPM:HL42:VOFF_SEL.L PP") } # Maintain multiple (up to 10) values of # a parameter: # # Record holding the parameter $[parm] # must FLNK -> $[parm]_SEQ # # Different values of the parameter # $[parm0]..$[parm9] are stored in # $[parm]_SEL.A .. $[parm]_SEL.J # # The actual value of the parameter is # selected based on the value of a controlling # PV $[ctrl] using a 'mapping' CALC expression # $[mapc] to convert the $[ctrl] value into # the integer range 1..10. # # The selected value of $[parm] is written # to output link $[outl] # # A) When the user writes $[parm] then # its value is deposited in the currently # selected field of $[parm]_SEL and # propagated to $[outl] # # B) When the user writes any of $[parm]_SEL.A..J # then the value is stored there. If she # writes to the currently 'active' field\ # (as selected by $[ctrl]) then # the $[parm] PV itself is updated and the # value is also propagated to $[outl] # # C) If the user changes $[ctrl] then the # corresponding value $[parm]_SEL.A..J is # propagated to $[outl] and $[parm]. # # D) At initialization, the value corresponding # to the initial setting of $[ctrl] is written # to $[outl] and $[parm] # # MACROS: # # $[parm] PV holding the parameter # $[ctrl] PV that controls the selection of # the currently active setting of # $[parm] # $[outl] PV where the currently selected # value of $[parm] shall be written-to # (if applicable) # $[prec] Precision of the $[parm]_SEL variable # (should be set to same value as $[parm].PREC) # # $[parm0]..$[parm9] initial values of $[parm] # # $[mapc] CALC expression to convert the value # of the controlling PV which is available # as 'A' to the range 1..10 (or less if # less selections are used). # E.g., to convert the value of a bo (0/1) # you would set mapc to 'A+1' (0..1 -> 1..2) # # NOTE: This sb snippet is loaded/expanded # for every parameter under control # of $[ctrl]. ALSO, the companion # snippet parmCtl.db must be loaded/expanded # but only once per controlling PV. # # This record, when scanned (as a result # of $[parm] being written and processing # its FLNK to this record] fetches $[parm] # and deposits the value into the currently # selected field of the SEL record. # # NOTE: unfortunately, the selection # mechanism of the SEQ and SEL # records differs: SEQ is 1-based, # SEL is 0-based -- now that makes # sense, doesn't it? # record(seq, "HL3A:SBPM:HL42:USCL_SEQ") { field(DESC, "Propagate Parm -> SEL") field(DOL1, "HL3A:SBPM:HL42:USCL") field(DOL2, "HL3A:SBPM:HL42:USCL") field(DOL3, "HL3A:SBPM:HL42:USCL") field(DOL4, "HL3A:SBPM:HL42:USCL") field(DOL5, "HL3A:SBPM:HL42:USCL") field(DOL6, "HL3A:SBPM:HL42:USCL") field(DOL7, "HL3A:SBPM:HL42:USCL") field(DOL8, "HL3A:SBPM:HL42:USCL") field(DOL9, "HL3A:SBPM:HL42:USCL") field(DOLA, "HL3A:SBPM:HL42:USCL") field(LNK1, "HL3A:SBPM:HL42:USCL_SEL.A PP") field(LNK2, "HL3A:SBPM:HL42:USCL_SEL.B PP") field(LNK3, "HL3A:SBPM:HL42:USCL_SEL.C PP") field(LNK4, "HL3A:SBPM:HL42:USCL_SEL.D PP") field(LNK5, "HL3A:SBPM:HL42:USCL_SEL.E PP") field(LNK6, "HL3A:SBPM:HL42:USCL_SEL.F PP") field(LNK7, "HL3A:SBPM:HL42:USCL_SEL.G PP") field(LNK8, "HL3A:SBPM:HL42:USCL_SEL.H PP") field(LNK9, "HL3A:SBPM:HL42:USCL_SEL.I PP") field(LNKA, "HL3A:SBPM:HL42:USCL_SEL.J PP") field(SELM, "Specified") field(SELL, "HL3A:SBPM:HL42:USCL_CTRL NPP NMS") } # The $[parm]_SEL record holds all possible # values of $[parm] in the 'A..J' fields. # # When processed it updates it's own VAL # to the currently selected input. Input # 'L' serves as the (1-based) selector, # i.e., L==1 selects 'A'->'VAL'. # # When the selected value changes (as a # result of SEQ depositing a new value OR # $[ctrl] changing and updating L) then # the propagator record attached to the # FLNK is processed. # record(sub, "HL3A:SBPM:HL42:USCL_SEL") { # field(INAM, "parmSelSubInit") field(SNAM, "parmSelSubProc") field(A, "1") field(B, "1") field(C, "") field(D, "") field(E, "") field(F, "") field(G, "") field(H, "") field(I, "") field(J, "") field(PREC, "4") field(FLNK, "HL3A:SBPM:HL42:USCL_PROP") info(autosaveFields, "A B C D E F G H I J") } # # Finally the dfanout record # fetches the currently selected # value from SEL and propagates it # to $[outl]. It also updates # $[parm] itself so that $[parm] # always reflects the currently # selected value. # record(dfanout, "HL3A:SBPM:HL42:USCL_PROP") { field(OMSL, "closed_loop") field(DOL, "HL3A:SBPM:HL42:USCL_SEL") field(OUTA, "HL3A:SBPM:HL42:U.ASLO CA") field(OUTB, "HL3A:SBPM:HL42:USCL PP") } # Drive the SEL record when the 'ctrl' PV changes # Use a CA link to monitor such changes record(calcout, "HL3A:SBPM:HL42:USCL_CTRL") { field(INPA, "HL3A:SBPM:HL42:PARMSEL CP") field(CALC, "A+1") field(DOPT, "Use CALC") field(OOPT, "On Change") field(OUT, "HL3A:SBPM:HL42:USCL_SEL.L PP") } # Maintain multiple (up to 10) values of # a parameter: # # Record holding the parameter $[parm] # must FLNK -> $[parm]_SEQ # # Different values of the parameter # $[parm0]..$[parm9] are stored in # $[parm]_SEL.A .. $[parm]_SEL.J # # The actual value of the parameter is # selected based on the value of a controlling # PV $[ctrl] using a 'mapping' CALC expression # $[mapc] to convert the $[ctrl] value into # the integer range 1..10. # # The selected value of $[parm] is written # to output link $[outl] # # A) When the user writes $[parm] then # its value is deposited in the currently # selected field of $[parm]_SEL and # propagated to $[outl] # # B) When the user writes any of $[parm]_SEL.A..J # then the value is stored there. If she # writes to the currently 'active' field\ # (as selected by $[ctrl]) then # the $[parm] PV itself is updated and the # value is also propagated to $[outl] # # C) If the user changes $[ctrl] then the # corresponding value $[parm]_SEL.A..J is # propagated to $[outl] and $[parm]. # # D) At initialization, the value corresponding # to the initial setting of $[ctrl] is written # to $[outl] and $[parm] # # MACROS: # # $[parm] PV holding the parameter # $[ctrl] PV that controls the selection of # the currently active setting of # $[parm] # $[outl] PV where the currently selected # value of $[parm] shall be written-to # (if applicable) # $[prec] Precision of the $[parm]_SEL variable # (should be set to same value as $[parm].PREC) # # $[parm0]..$[parm9] initial values of $[parm] # # $[mapc] CALC expression to convert the value # of the controlling PV which is available # as 'A' to the range 1..10 (or less if # less selections are used). # E.g., to convert the value of a bo (0/1) # you would set mapc to 'A+1' (0..1 -> 1..2) # # NOTE: This sb snippet is loaded/expanded # for every parameter under control # of $[ctrl]. ALSO, the companion # snippet parmCtl.db must be loaded/expanded # but only once per controlling PV. # # This record, when scanned (as a result # of $[parm] being written and processing # its FLNK to this record] fetches $[parm] # and deposits the value into the currently # selected field of the SEL record. # # NOTE: unfortunately, the selection # mechanism of the SEQ and SEL # records differs: SEQ is 1-based, # SEL is 0-based -- now that makes # sense, doesn't it? # record(seq, "HL3A:SBPM:HL42:VSCL_SEQ") { field(DESC, "Propagate Parm -> SEL") field(DOL1, "HL3A:SBPM:HL42:VSCL") field(DOL2, "HL3A:SBPM:HL42:VSCL") field(DOL3, "HL3A:SBPM:HL42:VSCL") field(DOL4, "HL3A:SBPM:HL42:VSCL") field(DOL5, "HL3A:SBPM:HL42:VSCL") field(DOL6, "HL3A:SBPM:HL42:VSCL") field(DOL7, "HL3A:SBPM:HL42:VSCL") field(DOL8, "HL3A:SBPM:HL42:VSCL") field(DOL9, "HL3A:SBPM:HL42:VSCL") field(DOLA, "HL3A:SBPM:HL42:VSCL") field(LNK1, "HL3A:SBPM:HL42:VSCL_SEL.A PP") field(LNK2, "HL3A:SBPM:HL42:VSCL_SEL.B PP") field(LNK3, "HL3A:SBPM:HL42:VSCL_SEL.C PP") field(LNK4, "HL3A:SBPM:HL42:VSCL_SEL.D PP") field(LNK5, "HL3A:SBPM:HL42:VSCL_SEL.E PP") field(LNK6, "HL3A:SBPM:HL42:VSCL_SEL.F PP") field(LNK7, "HL3A:SBPM:HL42:VSCL_SEL.G PP") field(LNK8, "HL3A:SBPM:HL42:VSCL_SEL.H PP") field(LNK9, "HL3A:SBPM:HL42:VSCL_SEL.I PP") field(LNKA, "HL3A:SBPM:HL42:VSCL_SEL.J PP") field(SELM, "Specified") field(SELL, "HL3A:SBPM:HL42:VSCL_CTRL NPP NMS") } # The $[parm]_SEL record holds all possible # values of $[parm] in the 'A..J' fields. # # When processed it updates it's own VAL # to the currently selected input. Input # 'L' serves as the (1-based) selector, # i.e., L==1 selects 'A'->'VAL'. # # When the selected value changes (as a # result of SEQ depositing a new value OR # $[ctrl] changing and updating L) then # the propagator record attached to the # FLNK is processed. # record(sub, "HL3A:SBPM:HL42:VSCL_SEL") { # field(INAM, "parmSelSubInit") field(SNAM, "parmSelSubProc") field(A, "1") field(B, "1") field(C, "") field(D, "") field(E, "") field(F, "") field(G, "") field(H, "") field(I, "") field(J, "") field(PREC, "4") field(FLNK, "HL3A:SBPM:HL42:VSCL_PROP") info(autosaveFields, "A B C D E F G H I J") } # # Finally the dfanout record # fetches the currently selected # value from SEL and propagates it # to $[outl]. It also updates # $[parm] itself so that $[parm] # always reflects the currently # selected value. # record(dfanout, "HL3A:SBPM:HL42:VSCL_PROP") { field(OMSL, "closed_loop") field(DOL, "HL3A:SBPM:HL42:VSCL_SEL") field(OUTA, "HL3A:SBPM:HL42:V.ASLO CA") field(OUTB, "HL3A:SBPM:HL42:VSCL PP") } # Drive the SEL record when the 'ctrl' PV changes # Use a CA link to monitor such changes record(calcout, "HL3A:SBPM:HL42:VSCL_CTRL") { field(INPA, "HL3A:SBPM:HL42:PARMSEL CP") field(CALC, "A+1") field(DOPT, "Use CALC") field(OOPT, "On Change") field(OUT, "HL3A:SBPM:HL42:VSCL_SEL.L PP") } # Maintain multiple (up to 10) values of # a parameter: # # Record holding the parameter $[parm] # must FLNK -> $[parm]_SEQ # # Different values of the parameter # $[parm0]..$[parm9] are stored in # $[parm]_SEL.A .. $[parm]_SEL.J # # The actual value of the parameter is # selected based on the value of a controlling # PV $[ctrl] using a 'mapping' CALC expression # $[mapc] to convert the $[ctrl] value into # the integer range 1..10. # # The selected value of $[parm] is written # to output link $[outl] # # A) When the user writes $[parm] then # its value is deposited in the currently # selected field of $[parm]_SEL and # propagated to $[outl] # # B) When the user writes any of $[parm]_SEL.A..J # then the value is stored there. If she # writes to the currently 'active' field\ # (as selected by $[ctrl]) then # the $[parm] PV itself is updated and the # value is also propagated to $[outl] # # C) If the user changes $[ctrl] then the # corresponding value $[parm]_SEL.A..J is # propagated to $[outl] and $[parm]. # # D) At initialization, the value corresponding # to the initial setting of $[ctrl] is written # to $[outl] and $[parm] # # MACROS: # # $[parm] PV holding the parameter # $[ctrl] PV that controls the selection of # the currently active setting of # $[parm] # $[outl] PV where the currently selected # value of $[parm] shall be written-to # (if applicable) # $[prec] Precision of the $[parm]_SEL variable # (should be set to same value as $[parm].PREC) # # $[parm0]..$[parm9] initial values of $[parm] # # $[mapc] CALC expression to convert the value # of the controlling PV which is available # as 'A' to the range 1..10 (or less if # less selections are used). # E.g., to convert the value of a bo (0/1) # you would set mapc to 'A+1' (0..1 -> 1..2) # # NOTE: This sb snippet is loaded/expanded # for every parameter under control # of $[ctrl]. ALSO, the companion # snippet parmCtl.db must be loaded/expanded # but only once per controlling PV. # # This record, when scanned (as a result # of $[parm] being written and processing # its FLNK to this record] fetches $[parm] # and deposits the value into the currently # selected field of the SEL record. # # NOTE: unfortunately, the selection # mechanism of the SEQ and SEL # records differs: SEQ is 1-based, # SEL is 0-based -- now that makes # sense, doesn't it? # record(seq, "HL3A:SBPM:HL42:PHI_SEQ") { field(DESC, "Propagate Parm -> SEL") field(DOL1, "HL3A:SBPM:HL42:PHI") field(DOL2, "HL3A:SBPM:HL42:PHI") field(DOL3, "HL3A:SBPM:HL42:PHI") field(DOL4, "HL3A:SBPM:HL42:PHI") field(DOL5, "HL3A:SBPM:HL42:PHI") field(DOL6, "HL3A:SBPM:HL42:PHI") field(DOL7, "HL3A:SBPM:HL42:PHI") field(DOL8, "HL3A:SBPM:HL42:PHI") field(DOL9, "HL3A:SBPM:HL42:PHI") field(DOLA, "HL3A:SBPM:HL42:PHI") field(LNK1, "HL3A:SBPM:HL42:PHI_SEL.A PP") field(LNK2, "HL3A:SBPM:HL42:PHI_SEL.B PP") field(LNK3, "HL3A:SBPM:HL42:PHI_SEL.C PP") field(LNK4, "HL3A:SBPM:HL42:PHI_SEL.D PP") field(LNK5, "HL3A:SBPM:HL42:PHI_SEL.E PP") field(LNK6, "HL3A:SBPM:HL42:PHI_SEL.F PP") field(LNK7, "HL3A:SBPM:HL42:PHI_SEL.G PP") field(LNK8, "HL3A:SBPM:HL42:PHI_SEL.H PP") field(LNK9, "HL3A:SBPM:HL42:PHI_SEL.I PP") field(LNKA, "HL3A:SBPM:HL42:PHI_SEL.J PP") field(SELM, "Specified") field(SELL, "HL3A:SBPM:HL42:PHI_CTRL NPP NMS") } # The $[parm]_SEL record holds all possible # values of $[parm] in the 'A..J' fields. # # When processed it updates it's own VAL # to the currently selected input. Input # 'L' serves as the (1-based) selector, # i.e., L==1 selects 'A'->'VAL'. # # When the selected value changes (as a # result of SEQ depositing a new value OR # $[ctrl] changing and updating L) then # the propagator record attached to the # FLNK is processed. # record(sub, "HL3A:SBPM:HL42:PHI_SEL") { # field(INAM, "parmSelSubInit") field(SNAM, "parmSelSubProc") field(A, "0") field(B, "0") field(C, "") field(D, "") field(E, "") field(F, "") field(G, "") field(H, "") field(I, "") field(J, "") field(PREC, "1") field(FLNK, "HL3A:SBPM:HL42:PHI_PROP") info(autosaveFields, "A B C D E F G H I J") } # # Finally the dfanout record # fetches the currently selected # value from SEL and propagates it # to $[outl]. It also updates # $[parm] itself so that $[parm] # always reflects the currently # selected value. # record(dfanout, "HL3A:SBPM:HL42:PHI_PROP") { field(OMSL, "closed_loop") field(DOL, "HL3A:SBPM:HL42:PHI_SEL") field(OUTA, "HL3A:SBPM:HL42:CALC.E CA") field(OUTB, "HL3A:SBPM:HL42:PHI PP") } # Drive the SEL record when the 'ctrl' PV changes # Use a CA link to monitor such changes record(calcout, "HL3A:SBPM:HL42:PHI_CTRL") { field(INPA, "HL3A:SBPM:HL42:PARMSEL CP") field(CALC, "A+1") field(DOPT, "Use CALC") field(OOPT, "On Change") field(OUT, "HL3A:SBPM:HL42:PHI_SEL.L PP") } # Maintain multiple (up to 10) values of # a parameter: # # Record holding the parameter $[parm] # must FLNK -> $[parm]_SEQ # # Different values of the parameter # $[parm0]..$[parm9] are stored in # $[parm]_SEL.A .. $[parm]_SEL.J # # The actual value of the parameter is # selected based on the value of a controlling # PV $[ctrl] using a 'mapping' CALC expression # $[mapc] to convert the $[ctrl] value into # the integer range 1..10. # # The selected value of $[parm] is written # to output link $[outl] # # A) When the user writes $[parm] then # its value is deposited in the currently # selected field of $[parm]_SEL and # propagated to $[outl] # # B) When the user writes any of $[parm]_SEL.A..J # then the value is stored there. If she # writes to the currently 'active' field\ # (as selected by $[ctrl]) then # the $[parm] PV itself is updated and the # value is also propagated to $[outl] # # C) If the user changes $[ctrl] then the # corresponding value $[parm]_SEL.A..J is # propagated to $[outl] and $[parm]. # # D) At initialization, the value corresponding # to the initial setting of $[ctrl] is written # to $[outl] and $[parm] # # MACROS: # # $[parm] PV holding the parameter # $[ctrl] PV that controls the selection of # the currently active setting of # $[parm] # $[outl] PV where the currently selected # value of $[parm] shall be written-to # (if applicable) # $[prec] Precision of the $[parm]_SEL variable # (should be set to same value as $[parm].PREC) # # $[parm0]..$[parm9] initial values of $[parm] # # $[mapc] CALC expression to convert the value # of the controlling PV which is available # as 'A' to the range 1..10 (or less if # less selections are used). # E.g., to convert the value of a bo (0/1) # you would set mapc to 'A+1' (0..1 -> 1..2) # # NOTE: This sb snippet is loaded/expanded # for every parameter under control # of $[ctrl]. ALSO, the companion # snippet parmCtl.db must be loaded/expanded # but only once per controlling PV. # # This record, when scanned (as a result # of $[parm] being written and processing # its FLNK to this record] fetches $[parm] # and deposits the value into the currently # selected field of the SEL record. # # NOTE: unfortunately, the selection # mechanism of the SEQ and SEL # records differs: SEQ is 1-based, # SEL is 0-based -- now that makes # sense, doesn't it? # record(seq, "HL3A:SBPM:HL42:PSI_SEQ") { field(DESC, "Propagate Parm -> SEL") field(DOL1, "HL3A:SBPM:HL42:PSI") field(DOL2, "HL3A:SBPM:HL42:PSI") field(DOL3, "HL3A:SBPM:HL42:PSI") field(DOL4, "HL3A:SBPM:HL42:PSI") field(DOL5, "HL3A:SBPM:HL42:PSI") field(DOL6, "HL3A:SBPM:HL42:PSI") field(DOL7, "HL3A:SBPM:HL42:PSI") field(DOL8, "HL3A:SBPM:HL42:PSI") field(DOL9, "HL3A:SBPM:HL42:PSI") field(DOLA, "HL3A:SBPM:HL42:PSI") field(LNK1, "HL3A:SBPM:HL42:PSI_SEL.A PP") field(LNK2, "HL3A:SBPM:HL42:PSI_SEL.B PP") field(LNK3, "HL3A:SBPM:HL42:PSI_SEL.C PP") field(LNK4, "HL3A:SBPM:HL42:PSI_SEL.D PP") field(LNK5, "HL3A:SBPM:HL42:PSI_SEL.E PP") field(LNK6, "HL3A:SBPM:HL42:PSI_SEL.F PP") field(LNK7, "HL3A:SBPM:HL42:PSI_SEL.G PP") field(LNK8, "HL3A:SBPM:HL42:PSI_SEL.H PP") field(LNK9, "HL3A:SBPM:HL42:PSI_SEL.I PP") field(LNKA, "HL3A:SBPM:HL42:PSI_SEL.J PP") field(SELM, "Specified") field(SELL, "HL3A:SBPM:HL42:PSI_CTRL NPP NMS") } # The $[parm]_SEL record holds all possible # values of $[parm] in the 'A..J' fields. # # When processed it updates it's own VAL # to the currently selected input. Input # 'L' serves as the (1-based) selector, # i.e., L==1 selects 'A'->'VAL'. # # When the selected value changes (as a # result of SEQ depositing a new value OR # $[ctrl] changing and updating L) then # the propagator record attached to the # FLNK is processed. # record(sub, "HL3A:SBPM:HL42:PSI_SEL") { # field(INAM, "parmSelSubInit") field(SNAM, "parmSelSubProc") field(A, "90") field(B, "90") field(C, "") field(D, "") field(E, "") field(F, "") field(G, "") field(H, "") field(I, "") field(J, "") field(PREC, "1") field(FLNK, "HL3A:SBPM:HL42:PSI_PROP") info(autosaveFields, "A B C D E F G H I J") } # # Finally the dfanout record # fetches the currently selected # value from SEL and propagates it # to $[outl]. It also updates # $[parm] itself so that $[parm] # always reflects the currently # selected value. # record(dfanout, "HL3A:SBPM:HL42:PSI_PROP") { field(OMSL, "closed_loop") field(DOL, "HL3A:SBPM:HL42:PSI_SEL") field(OUTA, "HL3A:SBPM:HL42:CALC.F CA") field(OUTB, "HL3A:SBPM:HL42:PSI PP") } # Drive the SEL record when the 'ctrl' PV changes # Use a CA link to monitor such changes record(calcout, "HL3A:SBPM:HL42:PSI_CTRL") { field(INPA, "HL3A:SBPM:HL42:PARMSEL CP") field(CALC, "A+1") field(DOPT, "Use CALC") field(OOPT, "On Change") field(OUT, "HL3A:SBPM:HL42:PSI_SEL.L PP") } record(longout, "HL3A:SBPM:HL42:PARMSEL") { field(VAL, "0") field(PINI, "YES") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBDEND # per BPM database for stripline BPMs ############################################## # This is the head of the main processing chain # that runs at the highest priority. ############################################## ############################################# # This is the head of the processing chain for # diagnostics. ############################################## record(ai, "HL3A:SBPM:HL43:GRN") { field(DESC, "GRN Strip Amplitude") field(DTYP, "Raw Bpm Signal") # 'card' selects PAD number, 'signal' selects strip field(INP, "#C7 S0") field(EGU, "raw") #TODO set HOPR/LOPR, alarm limits field(SCAN, "I/O Intr") # The priority determines what scan list we are being # put on (see drvPadUdpComm.c) field(PRIO, "LOW") field(FLNK, "HL3A:SBPM:HL43:RED") # HOPR for the energy algorithm is determined as follows: # # inf inf # 1) Fourier relation / h^2 dt = / |H|^2 df = 2 B # 0 -inf # # 1a) It can be shown that the maximum of the impuls response # ha is ~ 2 B # # 2) The digitizer produces the numbers # # Ai = 2^s (hi/ha) # # where ha is the maximum of the impuls response # and 2^s is a scale factor. # # 3) 'Energy algorithm' calculates S = sum( Ai^2 ) # # inf # 4) S = (2^s / ha)^2 sum(hi^2) = K sum(hi^2) Dt ~ K / h^2 dt # 0 # # with K = (2^s / ha)^2 fs # # 5) From 4) and 1a) -> S ~ K ha and therefore # # 6) S = 2^(2s) fs/ha = 2^(2s) fs/(2 B) # # 7) The strip signals are sqrt(S); hence HOPR is about # # HOPR ~ 2^s sqrt( fs/2/B ) # # with 2^s = 32768, fs=120MHz, B=10MHz it follows # that HOPR ~ 1E5; we add some margin... field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(ai, "HL3A:SBPM:HL43:RED") { field(DESC, "RED Strip Amplitude") field(DTYP, "Raw Bpm Signal") # 'card' selects PAD number, 'signal' selects strip field(INP, "#C7 S1") field(EGU, "raw") field(SCAN, "Passive") field(FLNK, "HL3A:SBPM:HL43:BLU") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(ai, "HL3A:SBPM:HL43:BLU") { field(DESC, "BLU Strip Amplitude") field(DTYP, "Raw Bpm Signal") # 'card' selects PAD number, 'signal' selects strip field(INP, "#C7 S2") field(EGU, "raw") field(SCAN, "Passive") field(FLNK, "HL3A:SBPM:HL43:YLO") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(ai, "HL3A:SBPM:HL43:YLO") { field(DESC, "YLO Strip Amplitude") field(DTYP, "Raw Bpm Signal") # 'card' selects PAD number, 'signal' selects strip field(INP, "#C7 S3") field(EGU, "raw") field(SCAN, "Passive") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } ############################################## # Slowly-scanned diagnostics ############################################## # record(waveform, "HL3A:SBPM:HL43:REDW") { field(DESC, "Raw CAL RED Data") field(DTYP, "WavBuf") # 'signal' number selects 'beam', 'calX', 'calY' field(INP, "#C7 S1") field(NELM, "512") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32768") field(LOPR, "-32767") field(SCAN, "1 second") } record(waveform, "HL3A:SBPM:HL43:GRNW") { field(DESC, "Raw CAL GRN Data") field(DTYP, "WavBuf") # 'signal' number selects 'beam', 'calX', 'calY' field(INP, "#C7 S2") field(NELM, "512") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32768") field(LOPR, "-32767") field(SCAN, "1 second") } record(waveform, "HL3A:SBPM:HL43:RAWDBG") { field(DESC, "Raw BEAM Dbg") field(DTYP, "WavBuf") # 'signal' number selects 'beam', 'calX', 'calY' # do not 'wbscan' for now since e.g., an underrange # condition on the real signal can happen. field(INP, "#C7 S7") field(NELM, "512") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32768") field(LOPR, "-32767") field(SCAN, "Passive") } record(waveform, "HL3A:SBPM:HL43:REDDBG") { field(DESC, "Raw CAL RED Dbg") field(DTYP, "WavBuf") # 'signal' number selects 'beam', 'calX', 'calY' field(INP, "#C7 S8 @wbscan") field(NELM, "512") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32768") field(LOPR, "-32767") field(SCAN, "Passive") } record(waveform, "HL3A:SBPM:HL43:GRNDBG") { field(DESC, "Raw CAL GRN Dbg") field(DTYP, "WavBuf") # 'signal' number selects 'beam', 'calX', 'calY' field(INP, "#C7 S9 @wbscan") field(NELM, "512") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32768") field(LOPR, "-32767") field(SCAN, "Passive") } record(ai, "HL3A:SBPM:HL43:GRUV") { field(DESC, "CAL Gain GRN/RED") field(DTYP, "Raw Stripl Calp") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C7 S0") field(SCAN, "10 second") field(PREC, "4") field(LOPR, "0.5") field(HOPR, "1.5") } record(ai, "HL3A:SBPM:HL43:GRU") { field(DESC, "CAL Gain GRN/BLU") field(DTYP, "Raw Stripl Calp") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C7 S1") field(SCAN, "10 second") field(PREC, "4") field(LOPR, "0.5") field(HOPR, "1.5") info(autosaveFields, "ASLO") } record(ai, "HL3A:SBPM:HL43:GRV") { field(DESC, "CAL Gain RED/YLO") field(DTYP, "Raw Stripl Calp") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C7 S2") field(SCAN, "10 second") field(PREC, "4") field(LOPR, "0.5") field(HOPR, "1.5") info(autosaveFields, "ASLO") } record(ai, "HL3A:SBPM:HL43:TGRN") { field(DESC, "Green arrival time") field(DTYP, "Raw Bpm Signal") field(EGU, "ADC Clocks") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C7 S4") field(SCAN, "10 second") field(PREC, "1") field(LOPR, "0") field(HOPR, "128") field(LOLO, "5") field(LOW, "8") field(HIGH, "60") field(HIHI, "70") field(LLSV, "MAJOR") field(LSV, "MINOR") field(HSV, "MINOR") field(HHSV, "MAJOR") } record(ai, "HL3A:SBPM:HL43:TRED") { field(DESC, "Red arrival time") field(DTYP, "Raw Bpm Signal") field(EGU, "ADC Clocks") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C7 S5") field(SCAN, "10 second") field(PREC, "1") field(LOPR, "0") field(HOPR, "128") field(LOLO, "5") field(LOW, "8") field(HIGH, "60") field(HIHI, "70") field(LLSV, "MAJOR") field(LSV, "MINOR") field(HSV, "MINOR") field(HHSV, "MAJOR") } record(ai, "HL3A:SBPM:HL43:TBLU") { field(DESC, "Blue arrival time") field(DTYP, "Raw Bpm Signal") field(EGU, "ADC Clocks") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C7 S6") field(SCAN, "10 second") field(PREC, "1") field(LOPR, "0") field(HOPR, "128") field(LOLO, "5") field(LOW, "8") field(HIGH, "60") field(HIHI, "70") field(LLSV, "MAJOR") field(LSV, "MINOR") field(HSV, "MINOR") field(HHSV, "MAJOR") } record(ai, "HL3A:SBPM:HL43:TYLO") { field(DESC, "Yellow arrival time") field(DTYP, "Raw Bpm Signal") field(EGU, "ADC Clocks") # 'card' selects PAD number, 'signal' selects cal coeff field(INP, "#C7 S7") field(SCAN, "10 second") field(PREC, "1") field(LOPR, "0") field(HOPR, "128") field(LOLO, "5") field(LOW, "8") field(HIGH, "60") field(HIHI, "70") field(LLSV, "MAJOR") field(LSV, "MINOR") field(HSV, "MINOR") field(HHSV, "MAJOR") } record(ao, "HL3A:SBPM:HL43:PINC_ADJ") { field(DESC, "Adjust Pinc. Corr.") field(DTYP, "Soft Channel") field(OUT, "HL3A:SBPM:HL43:CALC.K PP MS") field(VAL, "0") field(DRVL, "0") field(DRVH, "2") field(PINI, "YES") info(autosaveFields, "VAL") } # QSCL setting: # # Q: charge # Z: impedance # F: form factor: phi/(2 pi) sin(2 pi f l/c) # # Signal = Q Z F G h(t) = A h(t) [A] = Vs # # inf inf # Energy = A^2 / h^2(t) dt = A^2 / |H(w)|^2 dw/2/pi = A^2 B # 0 0 # # Measured energy = Sum{ (Vp/32768 * xi)^2 } / fs = S / fs ~ Energy # # -> A^2 B = S/fs # # With T = sqrt( Sum{ xi^2 } ) # # A = sqrt(S)/sqrt(B*fs) = T/sqrt(B*fs) Vp/32768 # # T/32768 Vp # Q = A/F/G/Z = ----------------- # F G Z sqrt(B*fs) # # Vp = { 1.5Vpp/2 (PGA=1) or 2.25Vpp/2 (PGA=0) } / 2 (transformer) # # I believe PGA is off (-> Vp ~ .56V) # # Z = 50 # # G: (calibration uses GRN/BLU -> signal should have the # level of the grn/red channels with the additional switch) # # Block diagram / parts / gain: # # [filt] [Att1] [Amp1] [Att2] [BPF] [Amp2] [pad] [Amp3] [switch] # f-17520 hmc540lp3 SBF-5089 hmc540lp3 MBP-140-6-4 SBF-4089 PAT-0 SBF-4089 HMC-197 # # -2dB* -1dB 20dB -1dB -4.5 14.8dB 0dB 14.8dB -0.4dB # # *: 1st filter ATT is a wild guess. # BPF loss (RLC Catalog, pp.55): (L (nsect+.5) / (% of 3dB BW) + .2) dB # with L ~6.2 10MHz/fc=140Mhz filter-> 4.5 # # -> Gtot ~ 40.7dB # # subtract cable loss (2dB); Gtot = 86 # # T/32768 Vp .56V/32768 # Q = A/F/G/Z = ----------------- = T/F ------------------------ # F G Z sqrt(B*fs) 86*50*sqrt(10*140)Mhz # # = T/F = 1.06E-7/F nC # # F for a 7% coverage, 4" BPM at 140MHz .07 sin(2*pi*140e6 4*.0254/3e8) # = .021 # # => 1.06E-7/.021 nC = 5E-6 nC # # (Faraday cup measurement -> (3600/44)^-1 1e-4 -> 1.22E-6 # record(ao, "HL3A:SBPM:HL43:QSCL") { field(DESC, "TMIT/Charge Scale") field(DTYP, "Soft Channel") field(OUT, "HL3A:SBPM:HL43:QSCA.A PP MS") # 5.0E-6 / 1.6E-10 [nC/e-] field(VAL, "31250") field(EGU, "Nel") field(PREC, "3") field(PINI, "YES") info(autosaveFields, "VAL") } # Adjust TMIT scale for AFE attenuation record(calcout, "HL3A:SBPM:HL43:QSCA") { field(DESC, "TMIT ATT Adj. Scale") field(INPB, "HL3A:SBPM:HL43:ATT1 CP") field(INPC, "HL3A:SBPM:HL43:ATT2 CP") field(CALC, "A*10^((B+C+D)/20)") # use CA link to deposit into TMIT.ASLO so # that TMIT is not forced into linkset # of this record field(OUT, "HL3A:SBPM:HL43:TMIT.ASLO CA") field(EGU, "Nel") field(PREC, "3") info(autosaveFields, "D") } record(ao, "HL3A:SBPM:HL43:ATT1SIMP") { field(DESC, "ATT1 Propagator") field(DTYP, "Soft Channel") field(DOL, "HL3A:SBPM:HL43:ATT1 CP") field(OMSL, "closed_loop") field(OUT, "HL3A:SBPM:HL43:ASIM.A PP") field(IVOA, "Set output to IVOV") field(IVOV, "0") field(EGU, "dB") } record(ao, "HL3A:SBPM:HL43:ATT2SIMP") { field(DESC, "ATT2 Propagator") field(DTYP, "Soft Channel") field(DOL, "HL3A:SBPM:HL43:ATT2 CP") field(OMSL, "closed_loop") field(OUT, "HL3A:SBPM:HL43:ASIM.C PP") field(IVOA, "Set output to IVOV") field(IVOV, "0") field(EGU, "dB") } # Attenuate charge either by # real attenuator settings or # by fake ones. # If B, C >= 0 then their # values will be used instead # of ATT1, ATT2 record(calcout, "HL3A:SBPM:HL43:ASIM") { field(DESC, "Q Simul Attenuator") field(DTYP, "Soft Channel") field(OUT, "HL3A:SBPM:HL43:QSIM.ESLO PP") # ATT1SIM puts value into A # set to -1 to use real attenuator settings # and >=0 to use B instead field(B, "-1") # ATT2SIM puts value into C # set to -1 to use real attenuator settings # and >=0 to use D instead field(D, "-1") field(CALC, "10^(((B>=0?B:A)+(D>=0?D:C))/20)") field(PINI, "YES") } record(ao, "HL3A:SBPM:HL43:WSIM") { field(DESC, "BPM W Simul.") field(DTYP, "Soft Channel") field(OUT, "HL3A:SBPM:HL43:SIM.G PP") field(VAL, "0.07") field(EGU, "%") field(PINI, "YES") field(PREC, "3") field(LOPR, "0") field(HOPR, "0.25") } record(sel, "HL3A:SBPM:HL43:STA") { field(DESC, "Status Summary") field(SELM, "High Signal") field(INPA, "HL3A:SBPM:HL43:RSTA.SEVR MS NPP") field(INPB, "HL3A:SBPM:HL43:TMIT.SEVR MS NPP") field(INPC, "HL3A:SBPM:HL43:Y.SEVR MS NPP") field(INPD, "HL3A:SBPM:HL43:X.SEVR MS NPP") field(INPE, "HL3A:SBPM:HL43:TGRN.SEVR MS NPP") field(INPF, "HL3A:SBPM:HL43:TRED.SEVR MS NPP") field(INPG, "HL3A:SBPM:HL43:TBLU.SEVR MS NPP") field(INPH, "HL3A:SBPM:HL43:TYLO.SEVR MS NPP") field(INPI, "HL3A:SBPM:HL43:GRU.SEVR MS NPP") field(INPJ, "HL3A:SBPM:HL43:GRV.SEVR MS NPP") field(SCAN, "1 second") } # This record really belongs on the # PAD IOC. We keep them here however # so we can save/restore. It is more # confusing but shouldn't matter from # an efficiency standpoint (they are # rarely changed). record(longout, "HL3A:SBPM:HL43:ATTO") { field(DESC, "AFE Tot. Att. Offset") # fetched via inlink #field(OUT, "HL3A:SBPM:HL43:ATTC.B PP") field(DRVL, "-10") field(DRVH, "30") field(LOPR, "-10") field(HOPR, "30") field(EGU, "dB") field(VAL, "0") field(PINI, "YES") info(autosaveFields, "VAL DRVH HOPR DRVL LOPR") } # This record really belongs on the # PAD IOC. We keep them here however # so we can save/restore. It is more # confusing but shouldn't matter from # an efficiency standpoint (they are # rarely changed). record(longout, "HL3A:SBPM:HL43:CLAO") { field(DESC, "AFE Cal. Att. Offset") # fetched via inlink #field(OUT, "HL3A:SBPM:HL43:ATTC.C PP") field(DRVL, "-20") field(DRVH, "20") field(LOPR, "-20") field(HOPR, "20") field(EGU, "dB") field(VAL, "40") field(PINI, "YES") info(autosaveFields, "VAL DRVH HOPR DRVL LOPR") } record(calc, "HL3A:SBPM:HL43:STA_ALH") { field(DESC, "Status Summary") field(SCAN, "1 second") field(CALC, "0") field(INPA, "HL3A:SBPM:HL43:RSTA_ALH.SEVR MS NPP") field(INPB, "HL3A:SBPM:HL43:GRU.SEVR MS NPP") field(INPC, "HL3A:SBPM:HL43:GRV.SEVR MS NPP") field(INPD, "HL3A:SBPM:HL43:CHK.SEVR MS NPP") field(INPE, "") field(INPF, "HL3A:SBPM:HL43:AFE_COMM.SEVR MS NPP") } # snapshot PV for the bpm values display record(ai, "HL3A:SBPM:HL43:GRN_SLOW") { field(DESC, "GRN snapshot for display") field(INP, "HL3A:SBPM:HL43:GRN NPP MS") field(EGU, "raw") field(SCAN, "1 second") field(FLNK, "HL3A:SBPM:HL43:RED_SLOW") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(ai, "HL3A:SBPM:HL43:RED_SLOW") { field(DESC, "RED snapshot for display") # 'card' selects PAD number, 'signal' selects strip field(INP, "HL3A:SBPM:HL43:RED NPP MS") field(EGU, "raw") field(SCAN, "Passive") field(FLNK, "HL3A:SBPM:HL43:BLU_SLOW") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(ai, "HL3A:SBPM:HL43:BLU_SLOW") { field(DESC, "BLU snapshot for display") # 'card' selects PAD number, 'signal' selects strip field(INP, "HL3A:SBPM:HL43:BLU NPP MS") field(EGU, "raw") field(SCAN, "Passive") field(FLNK, "HL3A:SBPM:HL43:YLO_SLOW") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(ai, "HL3A:SBPM:HL43:YLO_SLOW") { field(DESC, "YLO snapshot for display") field(INP, "HL3A:SBPM:HL43:YLO NPP MS") field(EGU, "raw") field(SCAN, "Passive") field(PREC, "1") field(LOPR, "0") field(HOPR, "1.4E5") field(LOLO, "1000") field(LOW, "2000") field(LLSV, "MAJOR") field(LSV, "MINOR") } record(sub, "HL3A:SBPM:HL43:CALC") { field(SNAM, "drvBpmBvectSetupSub") # E: phi F: psi # BPM channel number in L field(INPL, "7") field(SCAN, "Passive") } record(bo, "HL3A:SBPM:HL43:PINC_ENA") { field(DESC, "Simple Pincushion Alg") field(DTYP, "BusAddress") field(OUT, "#C0S2@drvBpmStriplPincEna,m32") field(MASK, "128") field(ZNAM, "DISABLED") field(ONAM, "ENABLED") field(VAL, "0") field(PINI, "YES") info(autosaveFields, "VAL") } record(ao, "HL3A:SBPM:HL43:UDR_THRES") { field(DESC, "Detection Underrange Threshold") field(DTYP, "Bpm Parameters") field(OUT, "#C7S0") field(EGU, "ADC Ticks") field(DOL, "45.26") field(PINI, "YES") field(DRVL, "0") field(DRVH, "32767") info(autosaveFields, "VAL") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBDEND # per BPM database for stripline BPMs ###################################### # HEAD of main processing chain ###################################### record(ai, "HL3A:SBPM:HL43:X") { field(DESC, "X Position") field(EGU, "mm") field(DTYP, "Raw Bpm Signal") field(INP, "#C7 S11") field(SCAN, "I/O Intr") # The priority determines what scan list we are being # put on (see drvPadUdpComm.c) field(PRIO, "HIGH") field(FLNK, "HL3A:SBPM:HL43:Y") field(PREC, "4") field(LOPR, "-12") field(HOPR, "+12") field(ASG, "") field(TSE, "-2") info(autosaveFields, "ASLO LOLO LOW HIGH HIHI HHSV LLSV") } record(ai, "HL3A:SBPM:HL43:Y") { field(DESC, "Y Position") field(EGU, "mm") field(DTYP, "Raw Bpm Signal") field(INP, "#C7 S12") field(FLNK, "HL3A:SBPM:HL43:TMIT") field(PREC, "4") field(LOPR, "-12") field(HOPR, "+12") field(ASG, "") field(TSE, "-2") info(autosaveFields, "ASLO LOLO LOW HIGH HIHI HHSV LLSV") } record(ai, "HL3A:SBPM:HL43:TMIT") { field(DESC, "Charge Estimate") field(DTYP, "Raw Bpm Signal") field(INP, "#C7 S13") field(EGU, "Nel") field(PREC, "3") field(LOPR, "0") field(HOPR, "1E11") # FLINK into BSA field(FLNK, "HL3A:SBPM:HL43:EFX.PROC") field(ASG, "") field(TSE, "-2") info(autosaveFields, "LOLO LOW HIGH HIHI HHSV LLSV ") } ###################################### # HEAD of diagnostics processing chain ###################################### # leave RWAV in it's own lockset; don't FLNK # to 'U' & friends record(waveform, "HL3A:SBPM:HL43:RWAV") { field(DESC, "Raw BPM Data") field(DTYP, "WavBuf") # 'signal' number selects 'beam', 'calX', 'calY' field(INP, "#C7 S0") field(SCAN, "I/O Intr") # use LOW or HIGH to end up on the 'diagnostic' # scan list (see drvPadUdpComm.c) field(PRIO, "LOW") field(NELM, "512") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32768") field(LOPR, "-32767") } record(ai, "HL3A:SBPM:HL43:U") { field(DESC, "Raw U Position") field(DTYP, "Raw Bpm Signal") field(INP, "#C7 S8") field(SCAN, "I/O Intr") # use LOW or HIGH to end up on the 'diagnostic' # scan list (see drvPadUdpComm.c) field(PRIO, "LOW") field(PREC, "5") field(EGU, "mm") field(LOPR, "-0.7") field(HOPR, "+0.7") field(FLNK, "HL3A:SBPM:HL43:V") } record(ai, "HL3A:SBPM:HL43:V") { field(DESC, "Raw V Position") field(DTYP, "Raw Bpm Signal") field(INP, "#C7 S9") field(SCAN, "Passive") field(PREC, "5") field(EGU, "mm") field(LOPR, "-0.7") field(HOPR, "+0.7") field(FLNK, "HL3A:SBPM:HL43:PINC") } record(ai, "HL3A:SBPM:HL43:PINC") { field(DESC, "Pin Cushion Corr.") field(DTYP, "Raw Bpm Signal") field(INP, "#C7 S10") field(SCAN, "Passive") } record(longin, "HL3A:SBPM:HL43:RSTA") { field(DESC, "Status of Raw Processor") field(DTYP, "Bpm Raw Status") field(INP, "#C7S0") field(SCAN, "1 second") field(LOLO, "-1") field(HIHI, "+1") field(HHSV, "INVALID") field(LLSV, "INVALID") field(FLNK, "HL3A:SBPM:HL43:RSTA_ALH") } record(calc, "HL3A:SBPM:HL43:RSTA_ALH") { field(CALC, "A & B") field(INPA, "HL3A:SBPM:HL43:RSTA") field(INPB, "0x30F") field(HIHI, "1") field(LOLO, "-1") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(SCAN, "Passive") } ###################################### # Input/Parameteres ###################################### record(ao, "HL3A:SBPM:HL43:PHI") { field(DESC, "Rot Angle") field(DTYP, "Soft Channel") field(VAL, "0") field(EGU, "deg") field(PREC, "1") field(LOPR, "-180") field(HOPR, "+180") field(FLNK, "HL3A:SBPM:HL43:PHI_SEQ") } record(ao, "HL3A:SBPM:HL43:PSI") { field(DESC, "Axis Sep. Angle") field(DTYP, "Soft Channel") field(VAL, "90") field(EGU, "deg") field(PREC, "1") field(LOPR, "0") field(HOPR, "+180") field(FLNK, "HL3A:SBPM:HL43:PSI_SEQ") } #record(dfanout, "HL3A:SBPM:HL43:PCMM") { # field(DESC, "BPM Scale") # field(OUTA, "HL3A:SBPM:HL43:USCL PP MS") # field(OUTB, "HL3A:SBPM:HL43:VSCL PP MS") # field(VAL, "12") # field(EGU, "mm") # field(PREC, "4") # field(LOPR, "5") # field(HOPR, "15") # field(PINI, "YES") #} record(ao, "HL3A:SBPM:HL43:UOFF") { field(DESC, "BPM U Offset") field(DTYP, "Soft Channel") field(VAL, "0") field(EGU, "mm") field(PREC, "4") field(LOPR, "-5") field(HOPR, "+5") field(FLNK, "HL3A:SBPM:HL43:UOFF_SEQ") } record(ao, "HL3A:SBPM:HL43:VOFF") { field(DESC, "BPM V Offset") field(DTYP, "Soft Channel") field(VAL, "0") field(EGU, "mm") field(PREC, "4") field(LOPR, "-5") field(HOPR, "+5") field(FLNK, "HL3A:SBPM:HL43:VOFF_SEQ") } record(ao, "HL3A:SBPM:HL43:USCL") { field(DESC, "BPM U Scale") field(DTYP, "Soft Channel") field(VAL, "1") field(EGU, "mm") field(PREC, "4") field(FLNK, "HL3A:SBPM:HL43:USCL_SEQ") } record(ao, "HL3A:SBPM:HL43:VSCL") { field(DESC, "BPM V Scale") field(DTYP, "Soft Channel") field(VAL, "1") field(EGU, "mm") field(PREC, "4") field(FLNK, "HL3A:SBPM:HL43:VSCL_SEQ") } record(mbbo, "HL3A:SBPM:HL43:ACCESS") { field(DESC, "BPM On Line") field(DTYP, "StreamSwitch") field(OUT, "#C7 S0") field(ZRVL, "1") field(ZRST, "Running") field(ZRSV, "NO_ALARM") field(ONVL, "1") field(ONST, "Maintenance") field(ONSV, "MINOR") field(TWVL, "1") field(TWST, "Test") field(TWSV, "MINOR") field(THVL, "0") field(THST, "OFFLINE") field(THSV, "MAJOR") # set both, rval and val to get it right # regardless of whether devsup does conversion # or not. field(RVAL, "0") field(VAL, "0") field(PINI, "YES") field(FLNK, "HL3A:SBPM:HL43:SIMOFF") info(autosaveFields, "RVAL") } # # 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, "HL3A:SBPM:HL43:FBCK") { field(DESC, "Feedback State") field(PINI, "YES") field(OMSL, "supervisory") field(VAL, "0") field(ZRVL, "0") field(ONVL, "1") field(TWVL, "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") info(autosaveFields, "VAL") } # Convenience record holding the MAD name record(stringin, "HL3A:SBPM:HL43:MADN") { field(DESC, "MAD Name") field(VAL, "SBPMHE43") field(PINI, "YES") } record(stringin, "SBPMHE43:NAME") { field(DESC, "BPM Name") field(VAL, "HL3A:SBPM:HL43") field(PINI, "YES") } record(ai, "HL3A:SBPM:HL43:X_SLOW") { #alias("HL3A:SBPM:HL43:X1H") field(DESC, "X snapshot for display") field(EGU, "mm") field(INP, "HL3A:SBPM:HL43:X MS") field(FLNK, "HL3A:SBPM:HL43:Y_SLOW") field(PREC, "4") field(SCAN, "1 second") field(LOPR, "-12") field(HOPR, "+12") } record(ai, "HL3A:SBPM:HL43:Y_SLOW") { #alias("HL3A:SBPM:HL43:Y1H") field(DESC, "Y snapshot for display") field(EGU, "mm") field(INP, "HL3A:SBPM:HL43:Y NPP MS") field(FLNK, "HL3A:SBPM:HL43:TMIT_SLOW") field(PREC, "4") field(LOPR, "-12") field(HOPR, "+12") } record(ai, "HL3A:SBPM:HL43:TMIT_SLOW") { #alias("HL3A:SBPM:HL43:TMIT1H") field(DESC, "TMIT snapshot for display") field(INP, "HL3A:SBPM:HL43:TMIT NPP MS") field(EGU, "Nel") field(PREC, "3") field(LOPR, "0") field(HOPR, "1E11") } ###################################### # Simulation Parameters + Control ###################################### # switch off simulation when going off-line record(calcout, "HL3A:SBPM:HL43:SIMOFF") { field(DESC, "Sim Off Propagator") field(INPA, "HL3A:SBPM:HL43:ACCESS.RVAL") field(CALC, "A") field(OCAL, "0") field(OOPT, "When Zero") field(DOPT, "Use OCAL") field(OUT, "HL3A:SBPM:HL43:SIMC PP") } record(calcout, "HL3A:SBPM:HL43:SIM") { field(DESC, "BPM Pos. Simulation") field(DTYP, "Strip Signal Simulator") field(OUT, "7") #CALC & VAL unused; the real calculation is done # in device support. The reason this is a # calcout rather than sub is that we want # to use the OUT link... field(CALC, "A") field(INPA, "HL3A:SBPM:HL43:USCL") field(INPL, "0") } # Switch simulation record HL3A:SBPM:HL43:SIMCSEQ moved to # bpmCavity.db.part and bpmStripl.db.part record(mbbo, "HL3A:SBPM:HL43:SIMC") { field(DESC, "Stripl Sim Ctl") field(DTYP, "Raw Soft Channel") field(OUT, "HL3A:SBPM:HL43:SIMCSEQ.SELN PP") field(ZRST, "OFF") field(ZRVL, "0x0f") field(ONST, "ON") field(ONVL, "0x1c0") field(TWST, "SOFT") field(TWVL, "0x030") field(MASK, "-1") field(NOBT, "16") field(VAL, "0") field(RVAL, "0x0f") field(PINI, "YES") } record(ao, "HL3A:SBPM:HL43:XSIM") { field(DESC, "BPM X Pos. Simul.") field(DTYP, "Soft Channel") field(OUT, "HL3A:SBPM:HL43:SIM.B PP") field(VAL, "0.5") field(EGU, "mm") field(PINI, "YES") field(PREC, "4") field(LOPR, "-12") field(HOPR, "+12") } record(ao, "HL3A:SBPM:HL43:YSIM") { field(DESC, "BPM Y Pos. Simul.") field(DTYP, "Soft Channel") field(OUT, "HL3A:SBPM:HL43:SIM.C PP") field(VAL, "0.") field(EGU, "mm") field(PINI, "YES") field(PREC, "4") field(LOPR, "-12") field(HOPR, "+12") } record(ao, "HL3A:SBPM:HL43:QSIM") { field(DESC, "BPM Q Simul.") field(DTYP, "Raw Soft Channel") field(OUT, "HL3A:SBPM:HL43:SIM.D PP") field(EGU, "Nel") field(ASLO, "6000") #ESLO is used to add attenuation field(LINR, "LINEAR") field(VAL, "1E9") field(PINI, "YES") field(PREC, "4") field(LOPR, "0") field(HOPR, "1E11") } record(ao, "HL3A:SBPM:HL43:ROTS") { field(DESC, "BPM Rot. Simul.") field(DTYP, "Soft Channel") field(OUT, "HL3A:SBPM:HL43:SIM.E PP") field(VAL, "0.") field(EGU, "deg") field(PINI, "YES") field(PREC, "1") field(LOPR, "-180") } record(ao, "HL3A:SBPM:HL43:PSIS") { field(DESC, "BPM Angle. Simul.") field(DTYP, "Soft Channel") field(OUT, "HL3A:SBPM:HL43:SIM.F PP") field(VAL, "90") field(EGU, "deg") field(PINI, "YES") field(PREC, "1") field(LOPR, "0") } record(aao, "HL3A:SBPM:HL43:DIGISIMW") { field(DESC, "VME Digi Sim. Waveform") field(DTYP, "VmeDigi Sim Wav") field(OUT, "#C7 S0") field(FTVL, "SHORT") field(EGU, "Counts") field(HOPR, "32678") field(LOPR, "-32768") # 16384 samples/channel * 4 channels field(NELM, "65536") field(PINI, "NO") } #Used by model/database folks to verify BPM record(ao, "HL3A:SBPM:HL43:Z") { field(DESC, "Z Position") field(PINI, "YES") info(autosaveFields, "VAL") } # MPS interface record(bo, "HL3A:SBPM:HL43:MPSBYP") { field(DESC, "MPS Bypass") field(DTYP, "BusAddress") field(OUT, "#C0S2@bpmMPS+0,m32") field(MASK, "128") field(ZNAM, "BYPASSED") field(ONAM, "NOT_BYPASSED") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(VAL, "0") field(PINI, "YES") field(ASG, "") info(autosaveFields, "VAL") } record(bo, "HL3A:SBPM:HL43:MPSLTBYP") { field(DESC, "MPS Bypass") field(DTYP, "BusAddress") field(OUT, "#C1S2@bpmMPS+0,m32") field(MASK, "128") field(ZNAM, "BYPASSED") field(ONAM, "NOT_BYPASSED") field(ZSV, "NO_ALARM") field(OSV, "NO_ALARM") field(VAL, "0") field(PINI, "YES") field(ASG, "") info(autosaveFields, "VAL") } record(calc, "HL3A:SBPM:HL43:MPSIGNRCALC") { field(DESC, "MPS ignore if TMIT too low") field(CALC, "A $[parm]_SEQ # # Different values of the parameter # $[parm0]..$[parm9] are stored in # $[parm]_SEL.A .. $[parm]_SEL.J # # The actual value of the parameter is # selected based on the value of a controlling # PV $[ctrl] using a 'mapping' CALC expression # $[mapc] to convert the $[ctrl] value into # the integer range 1..10. # # The selected value of $[parm] is written # to output link $[outl] # # A) When the user writes $[parm] then # its value is deposited in the currently # selected field of $[parm]_SEL and # propagated to $[outl] # # B) When the user writes any of $[parm]_SEL.A..J # then the value is stored there. If she # writes to the currently 'active' field\ # (as selected by $[ctrl]) then # the $[parm] PV itself is updated and the # value is also propagated to $[outl] # # C) If the user changes $[ctrl] then the # corresponding value $[parm]_SEL.A..J is # propagated to $[outl] and $[parm]. # # D) At initialization, the value corresponding # to the initial setting of $[ctrl] is written # to $[outl] and $[parm] # # MACROS: # # $[parm] PV holding the parameter # $[ctrl] PV that controls the selection of # the currently active setting of # $[parm] # $[outl] PV where the currently selected # value of $[parm] shall be written-to # (if applicable) # $[prec] Precision of the $[parm]_SEL variable # (should be set to same value as $[parm].PREC) # # $[parm0]..$[parm9] initial values of $[parm] # # $[mapc] CALC expression to convert the value # of the controlling PV which is available # as 'A' to the range 1..10 (or less if # less selections are used). # E.g., to convert the value of a bo (0/1) # you would set mapc to 'A+1' (0..1 -> 1..2) # # NOTE: This sb snippet is loaded/expanded # for every parameter under control # of $[ctrl]. ALSO, the companion # snippet parmCtl.db must be loaded/expanded # but only once per controlling PV. # # This record, when scanned (as a result # of $[parm] being written and processing # its FLNK to this record] fetches $[parm] # and deposits the value into the currently # selected field of the SEL record. # # NOTE: unfortunately, the selection # mechanism of the SEQ and SEL # records differs: SEQ is 1-based, # SEL is 0-based -- now that makes # sense, doesn't it? # record(seq, "HL3A:SBPM:HL43:UOFF_SEQ") { field(DESC, "Propagate Parm -> SEL") field(DOL1, "HL3A:SBPM:HL43:UOFF") field(DOL2, "HL3A:SBPM:HL43:UOFF") field(DOL3, "HL3A:SBPM:HL43:UOFF") field(DOL4, "HL3A:SBPM:HL43:UOFF") field(DOL5, "HL3A:SBPM:HL43:UOFF") field(DOL6, "HL3A:SBPM:HL43:UOFF") field(DOL7, "HL3A:SBPM:HL43:UOFF") field(DOL8, "HL3A:SBPM:HL43:UOFF") field(DOL9, "HL3A:SBPM:HL43:UOFF") field(DOLA, "HL3A:SBPM:HL43:UOFF") field(LNK1, "HL3A:SBPM:HL43:UOFF_SEL.A PP") field(LNK2, "HL3A:SBPM:HL43:UOFF_SEL.B PP") field(LNK3, "HL3A:SBPM:HL43:UOFF_SEL.C PP") field(LNK4, "HL3A:SBPM:HL43:UOFF_SEL.D PP") field(LNK5, "HL3A:SBPM:HL43:UOFF_SEL.E PP") field(LNK6, "HL3A:SBPM:HL43:UOFF_SEL.F PP") field(LNK7, "HL3A:SBPM:HL43:UOFF_SEL.G PP") field(LNK8, "HL3A:SBPM:HL43:UOFF_SEL.H PP") field(LNK9, "HL3A:SBPM:HL43:UOFF_SEL.I PP") field(LNKA, "HL3A:SBPM:HL43:UOFF_SEL.J PP") field(SELM, "Specified") field(SELL, "HL3A:SBPM:HL43:UOFF_CTRL NPP NMS") } # The $[parm]_SEL record holds all possible # values of $[parm] in the 'A..J' fields. # # When processed it updates it's own VAL # to the currently selected input. Input # 'L' serves as the (1-based) selector, # i.e., L==1 selects 'A'->'VAL'. # # When the selected value changes (as a # result of SEQ depositing a new value OR # $[ctrl] changing and updating L) then # the propagator record attached to the # FLNK is processed. # record(sub, "HL3A:SBPM:HL43:UOFF_SEL") { # field(INAM, "parmSelSubInit") field(SNAM, "parmSelSubProc") field(A, "0") field(B, "0") field(C, "") field(D, "") field(E, "") field(F, "") field(G, "") field(H, "") field(I, "") field(J, "") field(PREC, "4") field(FLNK, "HL3A:SBPM:HL43:UOFF_PROP") info(autosaveFields, "A B C D E F G H I J") } # # Finally the dfanout record # fetches the currently selected # value from SEL and propagates it # to $[outl]. It also updates # $[parm] itself so that $[parm] # always reflects the currently # selected value. # record(dfanout, "HL3A:SBPM:HL43:UOFF_PROP") { field(OMSL, "closed_loop") field(DOL, "HL3A:SBPM:HL43:UOFF_SEL") field(OUTA, "HL3A:SBPM:HL43:U.AOFF CA") field(OUTB, "HL3A:SBPM:HL43:UOFF PP") } # Drive the SEL record when the 'ctrl' PV changes # Use a CA link to monitor such changes record(calcout, "HL3A:SBPM:HL43:UOFF_CTRL") { field(INPA, "HL3A:SBPM:HL43:PARMSEL CP") field(CALC, "A+1") field(DOPT, "Use CALC") field(OOPT, "On Change") field(OUT, "HL3A:SBPM:HL43:UOFF_SEL.L PP") } # Maintain multiple (up to 10) values of # a parameter: # # Record holding the parameter $[parm] # must FLNK -> $[parm]_SEQ # # Different values of the parameter # $[parm0]..$[parm9] are stored in # $[parm]_SEL.A .. $[parm]_SEL.J # # The actual value of the parameter is # selected based on the value of a controlling # PV $[ctrl] using a 'mapping' CALC expression # $[mapc] to convert the $[ctrl] value into # the integer range 1..10. # # The selected value of $[parm] is written # to output link $[outl] # # A) When the user writes $[parm] then # its value is deposited in the currently # selected field of $[parm]_SEL and # propagated to $[outl] # # B) When the user writes any of $[parm]_SEL.A..J # then the value is stored there. If she # writes to the currently 'active' field\ # (as selected by $[ctrl]) then # the $[parm] PV itself is updated and the # value is also propagated to $[outl] # # C) If the user changes $[ctrl] then the # corresponding value $[parm]_SEL.A..J is # propagated to $[outl] and $[parm]. # # D) At initialization, the value corresponding # to the initial setting of $[ctrl] is written # to $[outl] and $[parm] # # MACROS: # # $[parm] PV holding the parameter # $[ctrl] PV that controls the selection of # the currently active setting of # $[parm] # $[outl] PV where the currently selected # value of $[parm] shall be written-to # (if applicable) # $[prec] Precision of the $[parm]_SEL variable # (should be set to same value as $[parm].PREC) # # $[parm0]..$[parm9] initial values of $[parm] # # $[mapc] CALC expression to convert the value # of the controlling PV which is available # as 'A' to the range 1..10 (or less if # less selections are used). # E.g., to convert the value of a bo (0/1) # you would set mapc to 'A+1' (0..1 -> 1..2) # # NOTE: This sb snippet is loaded/expanded # for every parameter under control # of $[ctrl]. ALSO, the companion # snippet parmCtl.db must be loaded/expanded # but only once per controlling PV. # # This record, when scanned (as a result # of $[parm] being written and processing # its FLNK to this record] fetches $[parm] # and deposits the value into the currently # selected field of the SEL record. # # NOTE: unfortunately, the selection # mechanism of the SEQ and SEL # records differs: SEQ is 1-based, # SEL is 0-based -- now that makes # sense, doesn't it? # record(seq, "HL3A:SBPM:HL43:VOFF_SEQ") { field(DESC, "Propagate Parm -> SEL") field(DOL1, "HL3A:SBPM:HL43:VOFF") field(DOL2, "HL3A:SBPM:HL43:VOFF") field(DOL3, "HL3A:SBPM:HL43:VOFF") field(DOL4, "HL3A:SBPM:HL43:VOFF") field(DOL5, "HL3A:SBPM:HL43:VOFF") field(DOL6, "HL3A:SBPM:HL43:VOFF") field(DOL7, "HL3A:SBPM:HL43:VOFF") field(DOL8, "HL3A:SBPM:HL43:VOFF") field(DOL9, "HL3A:SBPM:HL43:VOFF") field(DOLA, "HL3A:SBPM:HL43:VOFF") field(LNK1, "HL3A:SBPM:HL43:VOFF_SEL.A PP") field(LNK2, "HL3A:SBPM:HL43:VOFF_SEL.B PP") field(LNK3, "HL3A:SBPM:HL43:VOFF_SEL.C PP") field(LNK4, "HL3A:SBPM:HL43:VOFF_SEL.D PP") field(LNK5, "HL3A:SBPM:HL43:VOFF_SEL.E PP") field(LNK6, "HL3A:SBPM:HL43:VOFF_SEL.F PP") field(LNK7, "HL3A:SBPM:HL43:VOFF_SEL.G PP") field(LNK8, "HL3A:SBPM:HL43:VOFF_SEL.H PP") field(LNK9, "HL3A:SBPM:HL43:VOFF_SEL.I PP") field(LNKA, "HL3A:SBPM:HL43:VOFF_SEL.J PP") field(SELM, "Specified") field(SELL, "HL3A:SBPM:HL43:VOFF_CTRL NPP NMS") } # The $[parm]_SEL record holds all possible # values of $[parm] in the 'A..J' fields. # # When processed it updates it's own VAL # to the currently selected input. Input # 'L' serves as the (1-based) selector, # i.e., L==1 selects 'A'->'VAL'. # # When the selected value changes (as a # result of SEQ depositing a new value OR # $[ctrl] changing and updating L) then # the propagator record attached to the # FLNK is processed. # record(sub, "HL3A:SBPM:HL43:VOFF_SEL") { # field(INAM, "parmSelSubInit") field(SNAM, "parmSelSubProc") field(A, "0") field(B, "0") field(C, "") field(D, "") field(E, "") field(F, "") field(G, "") field(H, "") field(I, "") field(J, "") field(PREC, "4") field(FLNK, "HL3A:SBPM:HL43:VOFF_PROP") info(autosaveFields, "A B C D E F G H I J") } # # Finally the dfanout record # fetches the currently selected # value from SEL and propagates it # to $[outl]. It also updates # $[parm] itself so that $[parm] # always reflects the currently # selected value. # record(dfanout, "HL3A:SBPM:HL43:VOFF_PROP") { field(OMSL, "closed_loop") field(DOL, "HL3A:SBPM:HL43:VOFF_SEL") field(OUTA, "HL3A:SBPM:HL43:V.AOFF CA") field(OUTB, "HL3A:SBPM:HL43:VOFF PP") } # Drive the SEL record when the 'ctrl' PV changes # Use a CA link to monitor such changes record(calcout, "HL3A:SBPM:HL43:VOFF_CTRL") { field(INPA, "HL3A:SBPM:HL43:PARMSEL CP") field(CALC, "A+1") field(DOPT, "Use CALC") field(OOPT, "On Change") field(OUT, "HL3A:SBPM:HL43:VOFF_SEL.L PP") } # Maintain multiple (up to 10) values of # a parameter: # # Record holding the parameter $[parm] # must FLNK -> $[parm]_SEQ # # Different values of the parameter # $[parm0]..$[parm9] are stored in # $[parm]_SEL.A .. $[parm]_SEL.J # # The actual value of the parameter is # selected based on the value of a controlling # PV $[ctrl] using a 'mapping' CALC expression # $[mapc] to convert the $[ctrl] value into # the integer range 1..10. # # The selected value of $[parm] is written # to output link $[outl] # # A) When the user writes $[parm] then # its value is deposited in the currently # selected field of $[parm]_SEL and # propagated to $[outl] # # B) When the user writes any of $[parm]_SEL.A..J # then the value is stored there. If she # writes to the currently 'active' field\ # (as selected by $[ctrl]) then # the $[parm] PV itself is updated and the # value is also propagated to $[outl] # # C) If the user changes $[ctrl] then the # corresponding value $[parm]_SEL.A..J is # propagated to $[outl] and $[parm]. # # D) At initialization, the value corresponding # to the initial setting of $[ctrl] is written # to $[outl] and $[parm] # # MACROS: # # $[parm] PV holding the parameter # $[ctrl] PV that controls the selection of # the currently active setting of # $[parm] # $[outl] PV where the currently selected # value of $[parm] shall be written-to # (if applicable) # $[prec] Precision of the $[parm]_SEL variable # (should be set to same value as $[parm].PREC) # # $[parm0]..$[parm9] initial values of $[parm] # # $[mapc] CALC expression to convert the value # of the controlling PV which is available # as 'A' to the range 1..10 (or less if # less selections are used). # E.g., to convert the value of a bo (0/1) # you would set mapc to 'A+1' (0..1 -> 1..2) # # NOTE: This sb snippet is loaded/expanded # for every parameter under control # of $[ctrl]. ALSO, the companion # snippet parmCtl.db must be loaded/expanded # but only once per controlling PV. # # This record, when scanned (as a result # of $[parm] being written and processing # its FLNK to this record] fetches $[parm] # and deposits the value into the currently # selected field of the SEL record. # # NOTE: unfortunately, the selection # mechanism of the SEQ and SEL # records differs: SEQ is 1-based, # SEL is 0-based -- now that makes # sense, doesn't it? # record(seq, "HL3A:SBPM:HL43:USCL_SEQ") { field(DESC, "Propagate Parm -> SEL") field(DOL1, "HL3A:SBPM:HL43:USCL") field(DOL2, "HL3A:SBPM:HL43:USCL") field(DOL3, "HL3A:SBPM:HL43:USCL") field(DOL4, "HL3A:SBPM:HL43:USCL") field(DOL5, "HL3A:SBPM:HL43:USCL") field(DOL6, "HL3A:SBPM:HL43:USCL") field(DOL7, "HL3A:SBPM:HL43:USCL") field(DOL8, "HL3A:SBPM:HL43:USCL") field(DOL9, "HL3A:SBPM:HL43:USCL") field(DOLA, "HL3A:SBPM:HL43:USCL") field(LNK1, "HL3A:SBPM:HL43:USCL_SEL.A PP") field(LNK2, "HL3A:SBPM:HL43:USCL_SEL.B PP") field(LNK3, "HL3A:SBPM:HL43:USCL_SEL.C PP") field(LNK4, "HL3A:SBPM:HL43:USCL_SEL.D PP") field(LNK5, "HL3A:SBPM:HL43:USCL_SEL.E PP") field(LNK6, "HL3A:SBPM:HL43:USCL_SEL.F PP") field(LNK7, "HL3A:SBPM:HL43:USCL_SEL.G PP") field(LNK8, "HL3A:SBPM:HL43:USCL_SEL.H PP") field(LNK9, "HL3A:SBPM:HL43:USCL_SEL.I PP") field(LNKA, "HL3A:SBPM:HL43:USCL_SEL.J PP") field(SELM, "Specified") field(SELL, "HL3A:SBPM:HL43:USCL_CTRL NPP NMS") } # The $[parm]_SEL record holds all possible # values of $[parm] in the 'A..J' fields. # # When processed it updates it's own VAL # to the currently selected input. Input # 'L' serves as the (1-based) selector, # i.e., L==1 selects 'A'->'VAL'. # # When the selected value changes (as a # result of SEQ depositing a new value OR # $[ctrl] changing and updating L) then # the propagator record attached to the # FLNK is processed. # record(sub, "HL3A:SBPM:HL43:USCL_SEL") { # field(INAM, "parmSelSubInit") field(SNAM, "parmSelSubProc") field(A, "1") field(B, "1") field(C, "") field(D, "") field(E, "") field(F, "") field(G, "") field(H, "") field(I, "") field(J, "") field(PREC, "4") field(FLNK, "HL3A:SBPM:HL43:USCL_PROP") info(autosaveFields, "A B C D E F G H I J") } # # Finally the dfanout record # fetches the currently selected # value from SEL and propagates it # to $[outl]. It also updates # $[parm] itself so that $[parm] # always reflects the currently # selected value. # record(dfanout, "HL3A:SBPM:HL43:USCL_PROP") { field(OMSL, "closed_loop") field(DOL, "HL3A:SBPM:HL43:USCL_SEL") field(OUTA, "HL3A:SBPM:HL43:U.ASLO CA") field(OUTB, "HL3A:SBPM:HL43:USCL PP") } # Drive the SEL record when the 'ctrl' PV changes # Use a CA link to monitor such changes record(calcout, "HL3A:SBPM:HL43:USCL_CTRL") { field(INPA, "HL3A:SBPM:HL43:PARMSEL CP") field(CALC, "A+1") field(DOPT, "Use CALC") field(OOPT, "On Change") field(OUT, "HL3A:SBPM:HL43:USCL_SEL.L PP") } # Maintain multiple (up to 10) values of # a parameter: # # Record holding the parameter $[parm] # must FLNK -> $[parm]_SEQ # # Different values of the parameter # $[parm0]..$[parm9] are stored in # $[parm]_SEL.A .. $[parm]_SEL.J # # The actual value of the parameter is # selected based on the value of a controlling # PV $[ctrl] using a 'mapping' CALC expression # $[mapc] to convert the $[ctrl] value into # the integer range 1..10. # # The selected value of $[parm] is written # to output link $[outl] # # A) When the user writes $[parm] then # its value is deposited in the currently # selected field of $[parm]_SEL and # propagated to $[outl] # # B) When the user writes any of $[parm]_SEL.A..J # then the value is stored there. If she # writes to the currently 'active' field\ # (as selected by $[ctrl]) then # the $[parm] PV itself is updated and the # value is also propagated to $[outl] # # C) If the user changes $[ctrl] then the # corresponding value $[parm]_SEL.A..J is # propagated to $[outl] and $[parm]. # # D) At initialization, the value corresponding # to the initial setting of $[ctrl] is written # to $[outl] and $[parm] # # MACROS: # # $[parm] PV holding the parameter # $[ctrl] PV that controls the selection of # the currently active setting of # $[parm] # $[outl] PV where the currently selected # value of $[parm] shall be written-to # (if applicable) # $[prec] Precision of the $[parm]_SEL variable # (should be set to same value as $[parm].PREC) # # $[parm0]..$[parm9] initial values of $[parm] # # $[mapc] CALC expression to convert the value # of the controlling PV which is available # as 'A' to the range 1..10 (or less if # less selections are used). # E.g., to convert the value of a bo (0/1) # you would set mapc to 'A+1' (0..1 -> 1..2) # # NOTE: This sb snippet is loaded/expanded # for every parameter under control # of $[ctrl]. ALSO, the companion # snippet parmCtl.db must be loaded/expanded # but only once per controlling PV. # # This record, when scanned (as a result # of $[parm] being written and processing # its FLNK to this record] fetches $[parm] # and deposits the value into the currently # selected field of the SEL record. # # NOTE: unfortunately, the selection # mechanism of the SEQ and SEL # records differs: SEQ is 1-based, # SEL is 0-based -- now that makes # sense, doesn't it? # record(seq, "HL3A:SBPM:HL43:VSCL_SEQ") { field(DESC, "Propagate Parm -> SEL") field(DOL1, "HL3A:SBPM:HL43:VSCL") field(DOL2, "HL3A:SBPM:HL43:VSCL") field(DOL3, "HL3A:SBPM:HL43:VSCL") field(DOL4, "HL3A:SBPM:HL43:VSCL") field(DOL5, "HL3A:SBPM:HL43:VSCL") field(DOL6, "HL3A:SBPM:HL43:VSCL") field(DOL7, "HL3A:SBPM:HL43:VSCL") field(DOL8, "HL3A:SBPM:HL43:VSCL") field(DOL9, "HL3A:SBPM:HL43:VSCL") field(DOLA, "HL3A:SBPM:HL43:VSCL") field(LNK1, "HL3A:SBPM:HL43:VSCL_SEL.A PP") field(LNK2, "HL3A:SBPM:HL43:VSCL_SEL.B PP") field(LNK3, "HL3A:SBPM:HL43:VSCL_SEL.C PP") field(LNK4, "HL3A:SBPM:HL43:VSCL_SEL.D PP") field(LNK5, "HL3A:SBPM:HL43:VSCL_SEL.E PP") field(LNK6, "HL3A:SBPM:HL43:VSCL_SEL.F PP") field(LNK7, "HL3A:SBPM:HL43:VSCL_SEL.G PP") field(LNK8, "HL3A:SBPM:HL43:VSCL_SEL.H PP") field(LNK9, "HL3A:SBPM:HL43:VSCL_SEL.I PP") field(LNKA, "HL3A:SBPM:HL43:VSCL_SEL.J PP") field(SELM, "Specified") field(SELL, "HL3A:SBPM:HL43:VSCL_CTRL NPP NMS") } # The $[parm]_SEL record holds all possible # values of $[parm] in the 'A..J' fields. # # When processed it updates it's own VAL # to the currently selected input. Input # 'L' serves as the (1-based) selector, # i.e., L==1 selects 'A'->'VAL'. # # When the selected value changes (as a # result of SEQ depositing a new value OR # $[ctrl] changing and updating L) then # the propagator record attached to the # FLNK is processed. # record(sub, "HL3A:SBPM:HL43:VSCL_SEL") { # field(INAM, "parmSelSubInit") field(SNAM, "parmSelSubProc") field(A, "1") field(B, "1") field(C, "") field(D, "") field(E, "") field(F, "") field(G, "") field(H, "") field(I, "") field(J, "") field(PREC, "4") field(FLNK, "HL3A:SBPM:HL43:VSCL_PROP") info(autosaveFields, "A B C D E F G H I J") } # # Finally the dfanout record # fetches the currently selected # value from SEL and propagates it # to $[outl]. It also updates # $[parm] itself so that $[parm] # always reflects the currently # selected value. # record(dfanout, "HL3A:SBPM:HL43:VSCL_PROP") { field(OMSL, "closed_loop") field(DOL, "HL3A:SBPM:HL43:VSCL_SEL") field(OUTA, "HL3A:SBPM:HL43:V.ASLO CA") field(OUTB, "HL3A:SBPM:HL43:VSCL PP") } # Drive the SEL record when the 'ctrl' PV changes # Use a CA link to monitor such changes record(calcout, "HL3A:SBPM:HL43:VSCL_CTRL") { field(INPA, "HL3A:SBPM:HL43:PARMSEL CP") field(CALC, "A+1") field(DOPT, "Use CALC") field(OOPT, "On Change") field(OUT, "HL3A:SBPM:HL43:VSCL_SEL.L PP") } # Maintain multiple (up to 10) values of # a parameter: # # Record holding the parameter $[parm] # must FLNK -> $[parm]_SEQ # # Different values of the parameter # $[parm0]..$[parm9] are stored in # $[parm]_SEL.A .. $[parm]_SEL.J # # The actual value of the parameter is # selected based on the value of a controlling # PV $[ctrl] using a 'mapping' CALC expression # $[mapc] to convert the $[ctrl] value into # the integer range 1..10. # # The selected value of $[parm] is written # to output link $[outl] # # A) When the user writes $[parm] then # its value is deposited in the currently # selected field of $[parm]_SEL and # propagated to $[outl] # # B) When the user writes any of $[parm]_SEL.A..J # then the value is stored there. If she # writes to the currently 'active' field\ # (as selected by $[ctrl]) then # the $[parm] PV itself is updated and the # value is also propagated to $[outl] # # C) If the user changes $[ctrl] then the # corresponding value $[parm]_SEL.A..J is # propagated to $[outl] and $[parm]. # # D) At initialization, the value corresponding # to the initial setting of $[ctrl] is written # to $[outl] and $[parm] # # MACROS: # # $[parm] PV holding the parameter # $[ctrl] PV that controls the selection of # the currently active setting of # $[parm] # $[outl] PV where the currently selected # value of $[parm] shall be written-to # (if applicable) # $[prec] Precision of the $[parm]_SEL variable # (should be set to same value as $[parm].PREC) # # $[parm0]..$[parm9] initial values of $[parm] # # $[mapc] CALC expression to convert the value # of the controlling PV which is available # as 'A' to the range 1..10 (or less if # less selections are used). # E.g., to convert the value of a bo (0/1) # you would set mapc to 'A+1' (0..1 -> 1..2) # # NOTE: This sb snippet is loaded/expanded # for every parameter under control # of $[ctrl]. ALSO, the companion # snippet parmCtl.db must be loaded/expanded # but only once per controlling PV. # # This record, when scanned (as a result # of $[parm] being written and processing # its FLNK to this record] fetches $[parm] # and deposits the value into the currently # selected field of the SEL record. # # NOTE: unfortunately, the selection # mechanism of the SEQ and SEL # records differs: SEQ is 1-based, # SEL is 0-based -- now that makes # sense, doesn't it? # record(seq, "HL3A:SBPM:HL43:PHI_SEQ") { field(DESC, "Propagate Parm -> SEL") field(DOL1, "HL3A:SBPM:HL43:PHI") field(DOL2, "HL3A:SBPM:HL43:PHI") field(DOL3, "HL3A:SBPM:HL43:PHI") field(DOL4, "HL3A:SBPM:HL43:PHI") field(DOL5, "HL3A:SBPM:HL43:PHI") field(DOL6, "HL3A:SBPM:HL43:PHI") field(DOL7, "HL3A:SBPM:HL43:PHI") field(DOL8, "HL3A:SBPM:HL43:PHI") field(DOL9, "HL3A:SBPM:HL43:PHI") field(DOLA, "HL3A:SBPM:HL43:PHI") field(LNK1, "HL3A:SBPM:HL43:PHI_SEL.A PP") field(LNK2, "HL3A:SBPM:HL43:PHI_SEL.B PP") field(LNK3, "HL3A:SBPM:HL43:PHI_SEL.C PP") field(LNK4, "HL3A:SBPM:HL43:PHI_SEL.D PP") field(LNK5, "HL3A:SBPM:HL43:PHI_SEL.E PP") field(LNK6, "HL3A:SBPM:HL43:PHI_SEL.F PP") field(LNK7, "HL3A:SBPM:HL43:PHI_SEL.G PP") field(LNK8, "HL3A:SBPM:HL43:PHI_SEL.H PP") field(LNK9, "HL3A:SBPM:HL43:PHI_SEL.I PP") field(LNKA, "HL3A:SBPM:HL43:PHI_SEL.J PP") field(SELM, "Specified") field(SELL, "HL3A:SBPM:HL43:PHI_CTRL NPP NMS") } # The $[parm]_SEL record holds all possible # values of $[parm] in the 'A..J' fields. # # When processed it updates it's own VAL # to the currently selected input. Input # 'L' serves as the (1-based) selector, # i.e., L==1 selects 'A'->'VAL'. # # When the selected value changes (as a # result of SEQ depositing a new value OR # $[ctrl] changing and updating L) then # the propagator record attached to the # FLNK is processed. # record(sub, "HL3A:SBPM:HL43:PHI_SEL") { # field(INAM, "parmSelSubInit") field(SNAM, "parmSelSubProc") field(A, "0") field(B, "0") field(C, "") field(D, "") field(E, "") field(F, "") field(G, "") field(H, "") field(I, "") field(J, "") field(PREC, "1") field(FLNK, "HL3A:SBPM:HL43:PHI_PROP") info(autosaveFields, "A B C D E F G H I J") } # # Finally the dfanout record # fetches the currently selected # value from SEL and propagates it # to $[outl]. It also updates # $[parm] itself so that $[parm] # always reflects the currently # selected value. # record(dfanout, "HL3A:SBPM:HL43:PHI_PROP") { field(OMSL, "closed_loop") field(DOL, "HL3A:SBPM:HL43:PHI_SEL") field(OUTA, "HL3A:SBPM:HL43:CALC.E CA") field(OUTB, "HL3A:SBPM:HL43:PHI PP") } # Drive the SEL record when the 'ctrl' PV changes # Use a CA link to monitor such changes record(calcout, "HL3A:SBPM:HL43:PHI_CTRL") { field(INPA, "HL3A:SBPM:HL43:PARMSEL CP") field(CALC, "A+1") field(DOPT, "Use CALC") field(OOPT, "On Change") field(OUT, "HL3A:SBPM:HL43:PHI_SEL.L PP") } # Maintain multiple (up to 10) values of # a parameter: # # Record holding the parameter $[parm] # must FLNK -> $[parm]_SEQ # # Different values of the parameter # $[parm0]..$[parm9] are stored in # $[parm]_SEL.A .. $[parm]_SEL.J # # The actual value of the parameter is # selected based on the value of a controlling # PV $[ctrl] using a 'mapping' CALC expression # $[mapc] to convert the $[ctrl] value into # the integer range 1..10. # # The selected value of $[parm] is written # to output link $[outl] # # A) When the user writes $[parm] then # its value is deposited in the currently # selected field of $[parm]_SEL and # propagated to $[outl] # # B) When the user writes any of $[parm]_SEL.A..J # then the value is stored there. If she # writes to the currently 'active' field\ # (as selected by $[ctrl]) then # the $[parm] PV itself is updated and the # value is also propagated to $[outl] # # C) If the user changes $[ctrl] then the # corresponding value $[parm]_SEL.A..J is # propagated to $[outl] and $[parm]. # # D) At initialization, the value corresponding # to the initial setting of $[ctrl] is written # to $[outl] and $[parm] # # MACROS: # # $[parm] PV holding the parameter # $[ctrl] PV that controls the selection of # the currently active setting of # $[parm] # $[outl] PV where the currently selected # value of $[parm] shall be written-to # (if applicable) # $[prec] Precision of the $[parm]_SEL variable # (should be set to same value as $[parm].PREC) # # $[parm0]..$[parm9] initial values of $[parm] # # $[mapc] CALC expression to convert the value # of the controlling PV which is available # as 'A' to the range 1..10 (or less if # less selections are used). # E.g., to convert the value of a bo (0/1) # you would set mapc to 'A+1' (0..1 -> 1..2) # # NOTE: This sb snippet is loaded/expanded # for every parameter under control # of $[ctrl]. ALSO, the companion # snippet parmCtl.db must be loaded/expanded # but only once per controlling PV. # # This record, when scanned (as a result # of $[parm] being written and processing # its FLNK to this record] fetches $[parm] # and deposits the value into the currently # selected field of the SEL record. # # NOTE: unfortunately, the selection # mechanism of the SEQ and SEL # records differs: SEQ is 1-based, # SEL is 0-based -- now that makes # sense, doesn't it? # record(seq, "HL3A:SBPM:HL43:PSI_SEQ") { field(DESC, "Propagate Parm -> SEL") field(DOL1, "HL3A:SBPM:HL43:PSI") field(DOL2, "HL3A:SBPM:HL43:PSI") field(DOL3, "HL3A:SBPM:HL43:PSI") field(DOL4, "HL3A:SBPM:HL43:PSI") field(DOL5, "HL3A:SBPM:HL43:PSI") field(DOL6, "HL3A:SBPM:HL43:PSI") field(DOL7, "HL3A:SBPM:HL43:PSI") field(DOL8, "HL3A:SBPM:HL43:PSI") field(DOL9, "HL3A:SBPM:HL43:PSI") field(DOLA, "HL3A:SBPM:HL43:PSI") field(LNK1, "HL3A:SBPM:HL43:PSI_SEL.A PP") field(LNK2, "HL3A:SBPM:HL43:PSI_SEL.B PP") field(LNK3, "HL3A:SBPM:HL43:PSI_SEL.C PP") field(LNK4, "HL3A:SBPM:HL43:PSI_SEL.D PP") field(LNK5, "HL3A:SBPM:HL43:PSI_SEL.E PP") field(LNK6, "HL3A:SBPM:HL43:PSI_SEL.F PP") field(LNK7, "HL3A:SBPM:HL43:PSI_SEL.G PP") field(LNK8, "HL3A:SBPM:HL43:PSI_SEL.H PP") field(LNK9, "HL3A:SBPM:HL43:PSI_SEL.I PP") field(LNKA, "HL3A:SBPM:HL43:PSI_SEL.J PP") field(SELM, "Specified") field(SELL, "HL3A:SBPM:HL43:PSI_CTRL NPP NMS") } # The $[parm]_SEL record holds all possible # values of $[parm] in the 'A..J' fields. # # When processed it updates it's own VAL # to the currently selected input. Input # 'L' serves as the (1-based) selector, # i.e., L==1 selects 'A'->'VAL'. # # When the selected value changes (as a # result of SEQ depositing a new value OR # $[ctrl] changing and updating L) then # the propagator record attached to the # FLNK is processed. # record(sub, "HL3A:SBPM:HL43:PSI_SEL") { # field(INAM, "parmSelSubInit") field(SNAM, "parmSelSubProc") field(A, "90") field(B, "90") field(C, "") field(D, "") field(E, "") field(F, "") field(G, "") field(H, "") field(I, "") field(J, "") field(PREC, "1") field(FLNK, "HL3A:SBPM:HL43:PSI_PROP") info(autosaveFields, "A B C D E F G H I J") } # # Finally the dfanout record # fetches the currently selected # value from SEL and propagates it # to $[outl]. It also updates # $[parm] itself so that $[parm] # always reflects the currently # selected value. # record(dfanout, "HL3A:SBPM:HL43:PSI_PROP") { field(OMSL, "closed_loop") field(DOL, "HL3A:SBPM:HL43:PSI_SEL") field(OUTA, "HL3A:SBPM:HL43:CALC.F CA") field(OUTB, "HL3A:SBPM:HL43:PSI PP") } # Drive the SEL record when the 'ctrl' PV changes # Use a CA link to monitor such changes record(calcout, "HL3A:SBPM:HL43:PSI_CTRL") { field(INPA, "HL3A:SBPM:HL43:PARMSEL CP") field(CALC, "A+1") field(DOPT, "Use CALC") field(OOPT, "On Change") field(OUT, "HL3A:SBPM:HL43:PSI_SEL.L PP") } record(longout, "HL3A:SBPM:HL43:PARMSEL") { field(VAL, "0") field(PINI, "YES") } # bpmAfe.db; database for controlling stripline-BPM AFE # This database should not be loaded on PADs w/o AFE hardware. # # THIS FILE WAS GENERATED WITH msi FROM bpmPadAfe.template or bpmVmeDigiAfe.db AND EXPANDED FOR # # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # MODE: a -- Use VME IOC PVs # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # # NOTE: The template can be configured by means of proper macro # substitutions to # a) operate in 'normal' LCLS stripline BPM mode. In this # mode a few CA links to the VME/main IOC are active fetching # '$(dev):ACCESS', '$(dev):ATTO' and '$(dev):CLAO' from the # main IOC. # # b) standalone mode. In this mode, ACCESS is ignored and 'ATTO' and # 'CLAO' are instantiated / hosted on the PAD IOC. # # Mode 'a' is chosen by substituting # 'suffix' ='L', # 'propomsl' = 'closed_loop' # 'attomsl' = 'supervisory' # 'chrgL' = ' CPP' # 'actlL' = '$(dev):ACCESS.RVAL CP' # 'attoL' = '$(dev):ATTO CP' # 'claoL' = '$(dev):CLAO CP' # # Mode 'b' is chosen by substituting # 'suffix' = '' (empty) # 'propomsl' = 'supervisory' # 'attomsl' = 'supervisory' # 'chrgL' = '0' # 'actlL' = '0' # 'attoL' = '0' # 'claoL' = '0' # # SUBSTITUTIONS: # Substitutions available in main .db file # 'dev' : device name prefix # 'chrg' : name of global attenuator PV (for scaling all AFE attenuators with beam charge)(mode a) or '0' (mode b) # 'chrg' is only available in mode 'a'. # # Substitutions available in the template -- intended to be expanded when generating '.db' with MSI. # # 'chrgL' : name of global attenuator PV (for scaling all AFE attenuators with beam charge) + CPP attribute (mode a) or '0' (mode b) # 'actlL' : name of ACCESS.RVAL PV + CP attribute (mode a) or '0' (mode b) # 'attoL' : name of ATTO PV + CP attribute (mode a) or '0' (mode b) # 'claoL' : name of CLAO PV + CP attribute (mode a) or '0' (mode b) #'attomsl' : default/initial OMSL; if 'supervisory' then the 'ATT' PV controls attenuators # if 'closed_loop' then ATT is fetched from it's DOL (=='chrg' PV). # 'suffix' : see above. #'propomsl': see above. # # LINKS (pointing outside of this file): These links are only used in mode a and set to '0' in mode b. # HL2:SBPM:HL36:ATT.DOL <---- VIOC:GUN:BPM:ATTR CPP // DEFINED IN: [depends on 'chrg' macro substitution]. # HL2:SBPM:HL36:ACTL.DOL <---- HL2:SBPM:HL36:ACCESS.RVAL CP // DEFINED IN: associated main IOC database 'IOC--BPbpm.db' # HL2:SBPM:HL36:ATTOL.DOL<---- HL2:SBPM:HL36:ATTO CP // DEFINED IN: associated main IOC database 'IOC--BPbpm.db' # HL2:SBPM:HL36:CLAOL.DOL<---- HL2:SBPM:HL36:CLAO CP // DEFINED IN: associated main IOC database 'IOC--BPbpm.db' # # # # Additional macros added to support other architectures. These macros do NOT need to be populated for PAD AFEs # because the default value is set for them: # # instance - AFE identifier (0,1,... or identifying string) # devsup - device support name (qspiAfe for 'generic' suppport used by SLAC RTM and XTA AFE) # type - AFE flavor, 0 for PAD, 1 for XTA, 2 for RTM # record(longout, "HL2:SBPM:HL36:CALA") { field(DESC, "AFE Cal. Att.") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE0+1,qspiAfe") field(LOPR, "0") field(HOPR, "31") field(DRVL, "6") field(DRVH, "31") field(EGU, "dB") } record(longout, "HL2:SBPM:HL36:ATT1") { field(DESC, "AFE Att. 1") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE0+2,qspiAfe") field(LOPR, "0") field(HOPR, "15") field(DRVL, "0") field(DRVH, "15") field(EGU, "dB") } record(longout, "HL2:SBPM:HL36:ATT2") { field(DESC, "AFE Att. 2") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE0+3,qspiAfe") field(EGU, "dB") field(LOPR, "0") field(HOPR, "31") field(DRVL, "0") field(DRVH, "31") field(EGU, "dB") } # AFE FW versions (decimal): # 4 original LCLS-I FW version # >=32 ATT2 has 32 dB range; before 16 dB # 33 200 MHz board # 34 140 MHz board w/ 6dB PAD removed # 35 200 MHz board w/ 6dB PAD removed # > 64 140 MHz board not used with PAD/coldfire (XTA) # 8 MicroTCA RTM record(longin, "HL2:SBPM:HL36:VERS") { field(DESC, "AFE Firmware Vers.") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(INP, "#C0S0@AFE0+5,qspiAfe") field(LOLO, "3") field(LLSV, "MAJOR") } record(longout, "HL2:SBPM:HL36:AODL") { field(DESC, "Delay Trig -> AMP On") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE0+0x10,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVL, "255") } record(longout, "HL2:SBPM:HL36:R1DL") { field(DESC, "Delay AMP On -> RF1") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE0+0x11,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVL, "255") } record(longout, "HL2:SBPM:HL36:RFWD") { field(DESC, "RF Pulse Width") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE0+0x13,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVL, "255") info(autosaveFields, "VAL") } record(longout, "HL2:SBPM:HL36:OFFT") { field(DESC, "Delay RF Off -> Ctrl Sw.") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE0+0x14,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVL, "255") } record(longout, "HL2:SBPM:HL36:R2DL") { field(DESC, "Ctrl Sw. -> RF2") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE0+0x12,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVL, "255") } # This record just issues a CAL trigger record(longout, "HL2:SBPM:HL36:CALT") { field(DESC, "AFE CAL Soft Trigger") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE0+6,qspiAfe") } record(mbbo, "HL2:SBPM:HL36:CALM") { field(DESC, "AFE Cal. Mode") field(DTYP, "BusAddress") field(OUT, "#C0S0@AFE0+0,softTogAfe") field(NOBT, "2") field(SHFT, "0") field(ZRST, "CAL RED") field(ZRVL, "0") field(ONST, "CAL GRN") field(ONVL, "1") field(THST, "CAL NONE") field(THVL, "3") # 'soft toggle' mode. NOTE: LSB must match RED or GRN # which choses the mode to start with field(FRST, "CAL TOGGLE") field(FRVL, "4") field(VAL, "4") field(PINI, "YES") } # Subroutine to set up attenuator limits at ioc startup. # Attenuator ranges vary among AFE types and FW versions # This record also in bpmVmeDigiAfePart.db record(aSub, "HL2:SBPM:HL36:ATTINIT") { field(DESC, "Set up AFE att limits") field(PINI, "YES") field(SNAM, "subAttSetup") field(FTA, "LONG") field(INPA, "HL2:SBPM:HL36:VERS PP") field(FTVA, "LONG") field(OUTA, "HL2:SBPM:HL36:ATT1.HOPR") field(FTVB, "LONG") field(OUTB, "HL2:SBPM:HL36:ATT1.DRVH") field(FTVC, "LONG") field(OUTC, "HL2:SBPM:HL36:ATT2.HOPR") field(FTVD, "LONG") field(OUTD, "HL2:SBPM:HL36:ATT2.DRVH") field(FTVE, "LONG") field(OUTE, "HL2:SBPM:HL36:ATT.HOPR") field(FTVF, "LONG") field(OUTF, "HL2:SBPM:HL36:ATT.DRVH") field(FTVG, "LONG") field(OUTG, "HL2:SBPM:HL36:ATT.VAL") field(FTVH, "LONG") field(OUTH, "HL2:SBPM:HL36:ATTC.D") field(FTVI, "LONG") field(OUTI, "HL2:SBPM:HL36:ATTC.E") field(FTVJ, "LONG") field(OUTJ, "HL2:SBPM:HL36:ATTC.F") field(FTVK, "LONG") field(OUTK, "HL2:SBPM:HL36:ATTO.DRVL") field(FTVL, "LONG") field(OUTL, "HL2:SBPM:HL36:ATTO.LOPR") field(FTVM, "LONG") field(OUTM, "HL2:SBPM:HL36:ATTO.DRVH") field(FTVN, "LONG") field(OUTN, "HL2:SBPM:HL36:ATTO.HOPR") field(FTVO, "LONG") field(OUTO, "HL2:SBPM:HL36:CLAO.DRVL") field(FTVP, "LONG") field(OUTP, "HL2:SBPM:HL36:CLAO.LOPR") field(FTVQ, "LONG") field(OUTQ, "HL2:SBPM:HL36:CLAO.DRVH") field(FTVR, "LONG") field(OUTR, "HL2:SBPM:HL36:CLAO.HOPR") field(FLNK, "HL2:SBPM:HL36:ATT") } # Total attenuation (but ATTO is still added to this) record(longout, "HL2:SBPM:HL36:ATT") { field(DESC, "AFE Total Attenuation") field(OUT, "HL2:SBPM:HL36:ATTC.A PP") field(DRVL, "0") field(DRVH, "30") field(LOPR, "0") field(HOPR, "30") field(EGU, "dB") field(DOL, "VIOC:GUN:BPM:ATTR CPP") field(OMSL, "supervisory") field(VAL, "30") } # This subroutine record performs the # following operation (ATTC.D defines # the breakpoint where ATT1 kicks in # -- it depends on losses and gains: # BPT = G1 + L1 - L2 # with # G1: gain of 1st stage, # L1: loss + NF upstream of 1st stage, # L2: loss between 1st and 2nd stage + NF of 2nd stage # # if L1 : 2dB cable, 3dB 1st Filter, 1dB Att1 residual, 2.8dB NF = 8.8dB # L2 : 1dB Att2 residual, 4.5dB BPF, 3dB NF = 8.5dB # G1 : = 20.0dB # # -> breakpoint ~ 20dB # #----------------------------------------------------------------------------- # New RTM AFE characteristics are different (assume 140 ft LMR: 2.2db/100ft): # L1 : 3.1 dB cable, 4.5 dB 1st BPF, 1.1 dB att1, 3.3dB NF = 12.0dB # L2 : 1.1 dB att2, 2.7 dB NF, 1 dB BPF = 4.8dB # G1 : = 16.0dB # # -> breakpoint ~ 23dB # #----------------------------------------------------------------------------- # # Semantics of the different fields # A: Total attenuation (ATT records deposits value there) # B: ATTO # C: CLAO # D: BPT Breakpoint (see above) # E: (ATT1MAX) max. ATT1 attenuation (depends on version, set by ATTINIT) # F: (ATT2MAX) max. ATT2 attenuation (depends on version, set by ATTINIT) # # if ( (T=ATT+ATTO) > ATT1MAX + ATT2MAX ) # T = ATT1MAX + ATT2MAX # endif # # if ( (A1 = floor((T - BPT)/2)) < 0 ) # A1 = 0; # A2 = T; # else # if (A1 > ATT1MAX) # A1 = ATT1MAX; # endif # A2 = T - A1 # endif # # if ( A2 > ATT2MAX ) # A1 = A2-ATT2MAX # A2 = ATT2MAX # endif # # CA = CLAO + ATT1MAX + ATT2MAX - ATT # if ( CA < 0 ) # CA = 0 # else if ( CA > ACMAX ) # CA = ACMAX # endif # # Then, it writes three links: # HL2:SBPM:HL36:ATT1 = A1 # HL2:SBPM:HL36:ATT2 = A2 # HL2:SBPM:HL36:CALA = CA # record(sub, "HL2:SBPM:HL36:ATTC") { # Note: this record uses it's name to calculate # db link addresses to ATT1, ATT2, CALA field(DESC, "AFE Total Att. Calc.") # initialize fields to max. attenuation: # During init: # 1. hw initializes to max # 2. this record holds max # 3. PINI of the placeholder PVs (ATT, ATTO & friends) # trickle in and cause the total attenuation to # go down... field(A, "30") field(B, "0") field(C, "60") field(D, "20") field(EGU, "dB") field(INAM, "subAttIni") field(SNAM, "subAtt") } #propagate 'ACCESS.RVAL' state to #attenuator control #This record is unused in stdalone mode 'b' record(bo, "HL2:SBPM:HL36:ACTL") { field(DESC, "ATT OMSL Ctrl") field(DTYP, "Soft Channel") field(DOL, "HL2:SBPM:HL36:ACCESS.RVAL CP") field(OMSL, "closed_loop") field(OUT, "HL2:SBPM:HL36:ATT.OMSL PP") } ### ### Keep 'ATTO' and 'CLAO' on the main/VME IOC. ### It is more confusing but then we don't have ### to restore anything across reboots on the PAD ### IOC... ### ### This db now used for AFEs controlled by either ### a VME IOC or a PAD IOC. Use the same db for ### both for simplicity. ### ### NOTE: We could use the INPB / INPC ### links of ATTC directly but we DONT. ### Potentially, ATTC can be processed ### on every shot -- we don't want the ### links to be fetched every time for ### efficiency reasons. Hence the 'propagator' ### records which monitor ATTO/CLAO and ### write to ATTC.B ATTC.C only when ### necessary... record(longout, "HL2:SBPM:HL36:ATTOL") { field(DESC, "ATTO Propagator") field(DTYP, "Soft Channel") field(DOL, "HL2:SBPM:HL36:ATTO CP") field(OMSL, "closed_loop") field(OUT, "HL2:SBPM:HL36:ATTC.B PP") field(EGU, "dB") } record(longout, "HL2:SBPM:HL36:CLAOL") { field(DESC, "CLAO Propagator") field(DTYP, "Soft Channel") field(DOL, "HL2:SBPM:HL36:CLAO CP") field(OMSL, "closed_loop") field(OUT, "HL2:SBPM:HL36:ATTC.C PP") field(EGU, "dB") } record(calc, "HL2:SBPM:HL36:AFE_COMM_CALC") { field(DESC, "AFE communication error") field(SCAN, "10 second") field(CALC, "(A>0 && A<255)?1:0") field(INPA, "HL2:SBPM:HL36:VERS PP") field(FLNK, "HL2:SBPM:HL36:AFE_COMM") } record(bi, "HL2:SBPM:HL36:AFE_COMM") { field(DESC, "AFE communication error") field(INP, "HL2:SBPM:HL36:AFE_COMM_CALC") field(ZNAM, "Fault") field(ZSV, "MAJOR") field(ONAM, "Ok") } # Records only needed for RTM AFE record(longout, "HL2:SBPM:HL36:TRIG2BEAM") { field(DESC, "Trigger -> ADC trig") field(DTYP, "BusAddress") field(OUT, "#C0S0@AFE0+0x15,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVH, "255") field(PINI, "YES") info(autosaveFields, "VAL") } record(longout, "HL2:SBPM:HL36:RF2RED") { field(DESC, "Red RF -> ADC trig") field(DTYP, "BusAddress") field(OUT, "#C0S0@AFE0+0x16,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVH, "255") field(VAL, "6") field(PINI, "YES") info(autosaveFields, "VAL") } record(longout, "HL2:SBPM:HL36:RF2GRN") { field(DESC, "Grn RF -> ADC trig") field(DTYP, "BusAddress") field(OUT, "#C0S0@AFE0+0x17,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVH, "255") field(VAL, "6") field(PINI, "YES") info(autosaveFields, "VAL") } # bpmAfe.db; database for controlling stripline-BPM AFE # This database should not be loaded on PADs w/o AFE hardware. # # THIS FILE WAS GENERATED WITH msi FROM bpmPadAfe.template or bpmVmeDigiAfe.db AND EXPANDED FOR # # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # MODE: a -- Use VME IOC PVs # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # # NOTE: The template can be configured by means of proper macro # substitutions to # a) operate in 'normal' LCLS stripline BPM mode. In this # mode a few CA links to the VME/main IOC are active fetching # '$(dev):ACCESS', '$(dev):ATTO' and '$(dev):CLAO' from the # main IOC. # # b) standalone mode. In this mode, ACCESS is ignored and 'ATTO' and # 'CLAO' are instantiated / hosted on the PAD IOC. # # Mode 'a' is chosen by substituting # 'suffix' ='L', # 'propomsl' = 'closed_loop' # 'attomsl' = 'supervisory' # 'chrgL' = ' CPP' # 'actlL' = '$(dev):ACCESS.RVAL CP' # 'attoL' = '$(dev):ATTO CP' # 'claoL' = '$(dev):CLAO CP' # # Mode 'b' is chosen by substituting # 'suffix' = '' (empty) # 'propomsl' = 'supervisory' # 'attomsl' = 'supervisory' # 'chrgL' = '0' # 'actlL' = '0' # 'attoL' = '0' # 'claoL' = '0' # # SUBSTITUTIONS: # Substitutions available in main .db file # 'dev' : device name prefix # 'chrg' : name of global attenuator PV (for scaling all AFE attenuators with beam charge)(mode a) or '0' (mode b) # 'chrg' is only available in mode 'a'. # # Substitutions available in the template -- intended to be expanded when generating '.db' with MSI. # # 'chrgL' : name of global attenuator PV (for scaling all AFE attenuators with beam charge) + CPP attribute (mode a) or '0' (mode b) # 'actlL' : name of ACCESS.RVAL PV + CP attribute (mode a) or '0' (mode b) # 'attoL' : name of ATTO PV + CP attribute (mode a) or '0' (mode b) # 'claoL' : name of CLAO PV + CP attribute (mode a) or '0' (mode b) #'attomsl' : default/initial OMSL; if 'supervisory' then the 'ATT' PV controls attenuators # if 'closed_loop' then ATT is fetched from it's DOL (=='chrg' PV). # 'suffix' : see above. #'propomsl': see above. # # LINKS (pointing outside of this file): These links are only used in mode a and set to '0' in mode b. # HL2:SBPM:HL37:ATT.DOL <---- VIOC:GUN:BPM:ATTR CPP // DEFINED IN: [depends on 'chrg' macro substitution]. # HL2:SBPM:HL37:ACTL.DOL <---- HL2:SBPM:HL37:ACCESS.RVAL CP // DEFINED IN: associated main IOC database 'IOC--BPbpm.db' # HL2:SBPM:HL37:ATTOL.DOL<---- HL2:SBPM:HL37:ATTO CP // DEFINED IN: associated main IOC database 'IOC--BPbpm.db' # HL2:SBPM:HL37:CLAOL.DOL<---- HL2:SBPM:HL37:CLAO CP // DEFINED IN: associated main IOC database 'IOC--BPbpm.db' # # # # Additional macros added to support other architectures. These macros do NOT need to be populated for PAD AFEs # because the default value is set for them: # # instance - AFE identifier (0,1,... or identifying string) # devsup - device support name (qspiAfe for 'generic' suppport used by SLAC RTM and XTA AFE) # type - AFE flavor, 0 for PAD, 1 for XTA, 2 for RTM # record(longout, "HL2:SBPM:HL37:CALA") { field(DESC, "AFE Cal. Att.") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE1+1,qspiAfe") field(LOPR, "0") field(HOPR, "31") field(DRVL, "6") field(DRVH, "31") field(EGU, "dB") } record(longout, "HL2:SBPM:HL37:ATT1") { field(DESC, "AFE Att. 1") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE1+2,qspiAfe") field(LOPR, "0") field(HOPR, "15") field(DRVL, "0") field(DRVH, "15") field(EGU, "dB") } record(longout, "HL2:SBPM:HL37:ATT2") { field(DESC, "AFE Att. 2") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE1+3,qspiAfe") field(EGU, "dB") field(LOPR, "0") field(HOPR, "31") field(DRVL, "0") field(DRVH, "31") field(EGU, "dB") } # AFE FW versions (decimal): # 4 original LCLS-I FW version # >=32 ATT2 has 32 dB range; before 16 dB # 33 200 MHz board # 34 140 MHz board w/ 6dB PAD removed # 35 200 MHz board w/ 6dB PAD removed # > 64 140 MHz board not used with PAD/coldfire (XTA) # 8 MicroTCA RTM record(longin, "HL2:SBPM:HL37:VERS") { field(DESC, "AFE Firmware Vers.") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(INP, "#C0S0@AFE1+5,qspiAfe") field(LOLO, "3") field(LLSV, "MAJOR") } record(longout, "HL2:SBPM:HL37:AODL") { field(DESC, "Delay Trig -> AMP On") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE1+0x10,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVL, "255") } record(longout, "HL2:SBPM:HL37:R1DL") { field(DESC, "Delay AMP On -> RF1") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE1+0x11,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVL, "255") } record(longout, "HL2:SBPM:HL37:RFWD") { field(DESC, "RF Pulse Width") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE1+0x13,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVL, "255") info(autosaveFields, "VAL") } record(longout, "HL2:SBPM:HL37:OFFT") { field(DESC, "Delay RF Off -> Ctrl Sw.") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE1+0x14,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVL, "255") } record(longout, "HL2:SBPM:HL37:R2DL") { field(DESC, "Ctrl Sw. -> RF2") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE1+0x12,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVL, "255") } # This record just issues a CAL trigger record(longout, "HL2:SBPM:HL37:CALT") { field(DESC, "AFE CAL Soft Trigger") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE1+6,qspiAfe") } record(mbbo, "HL2:SBPM:HL37:CALM") { field(DESC, "AFE Cal. Mode") field(DTYP, "BusAddress") field(OUT, "#C0S0@AFE1+0,softTogAfe") field(NOBT, "2") field(SHFT, "0") field(ZRST, "CAL RED") field(ZRVL, "0") field(ONST, "CAL GRN") field(ONVL, "1") field(THST, "CAL NONE") field(THVL, "3") # 'soft toggle' mode. NOTE: LSB must match RED or GRN # which choses the mode to start with field(FRST, "CAL TOGGLE") field(FRVL, "4") field(VAL, "4") field(PINI, "YES") } # Subroutine to set up attenuator limits at ioc startup. # Attenuator ranges vary among AFE types and FW versions # This record also in bpmVmeDigiAfePart.db record(aSub, "HL2:SBPM:HL37:ATTINIT") { field(DESC, "Set up AFE att limits") field(PINI, "YES") field(SNAM, "subAttSetup") field(FTA, "LONG") field(INPA, "HL2:SBPM:HL37:VERS PP") field(FTVA, "LONG") field(OUTA, "HL2:SBPM:HL37:ATT1.HOPR") field(FTVB, "LONG") field(OUTB, "HL2:SBPM:HL37:ATT1.DRVH") field(FTVC, "LONG") field(OUTC, "HL2:SBPM:HL37:ATT2.HOPR") field(FTVD, "LONG") field(OUTD, "HL2:SBPM:HL37:ATT2.DRVH") field(FTVE, "LONG") field(OUTE, "HL2:SBPM:HL37:ATT.HOPR") field(FTVF, "LONG") field(OUTF, "HL2:SBPM:HL37:ATT.DRVH") field(FTVG, "LONG") field(OUTG, "HL2:SBPM:HL37:ATT.VAL") field(FTVH, "LONG") field(OUTH, "HL2:SBPM:HL37:ATTC.D") field(FTVI, "LONG") field(OUTI, "HL2:SBPM:HL37:ATTC.E") field(FTVJ, "LONG") field(OUTJ, "HL2:SBPM:HL37:ATTC.F") field(FTVK, "LONG") field(OUTK, "HL2:SBPM:HL37:ATTO.DRVL") field(FTVL, "LONG") field(OUTL, "HL2:SBPM:HL37:ATTO.LOPR") field(FTVM, "LONG") field(OUTM, "HL2:SBPM:HL37:ATTO.DRVH") field(FTVN, "LONG") field(OUTN, "HL2:SBPM:HL37:ATTO.HOPR") field(FTVO, "LONG") field(OUTO, "HL2:SBPM:HL37:CLAO.DRVL") field(FTVP, "LONG") field(OUTP, "HL2:SBPM:HL37:CLAO.LOPR") field(FTVQ, "LONG") field(OUTQ, "HL2:SBPM:HL37:CLAO.DRVH") field(FTVR, "LONG") field(OUTR, "HL2:SBPM:HL37:CLAO.HOPR") field(FLNK, "HL2:SBPM:HL37:ATT") } # Total attenuation (but ATTO is still added to this) record(longout, "HL2:SBPM:HL37:ATT") { field(DESC, "AFE Total Attenuation") field(OUT, "HL2:SBPM:HL37:ATTC.A PP") field(DRVL, "0") field(DRVH, "30") field(LOPR, "0") field(HOPR, "30") field(EGU, "dB") field(DOL, "VIOC:GUN:BPM:ATTR CPP") field(OMSL, "supervisory") field(VAL, "30") } # This subroutine record performs the # following operation (ATTC.D defines # the breakpoint where ATT1 kicks in # -- it depends on losses and gains: # BPT = G1 + L1 - L2 # with # G1: gain of 1st stage, # L1: loss + NF upstream of 1st stage, # L2: loss between 1st and 2nd stage + NF of 2nd stage # # if L1 : 2dB cable, 3dB 1st Filter, 1dB Att1 residual, 2.8dB NF = 8.8dB # L2 : 1dB Att2 residual, 4.5dB BPF, 3dB NF = 8.5dB # G1 : = 20.0dB # # -> breakpoint ~ 20dB # #----------------------------------------------------------------------------- # New RTM AFE characteristics are different (assume 140 ft LMR: 2.2db/100ft): # L1 : 3.1 dB cable, 4.5 dB 1st BPF, 1.1 dB att1, 3.3dB NF = 12.0dB # L2 : 1.1 dB att2, 2.7 dB NF, 1 dB BPF = 4.8dB # G1 : = 16.0dB # # -> breakpoint ~ 23dB # #----------------------------------------------------------------------------- # # Semantics of the different fields # A: Total attenuation (ATT records deposits value there) # B: ATTO # C: CLAO # D: BPT Breakpoint (see above) # E: (ATT1MAX) max. ATT1 attenuation (depends on version, set by ATTINIT) # F: (ATT2MAX) max. ATT2 attenuation (depends on version, set by ATTINIT) # # if ( (T=ATT+ATTO) > ATT1MAX + ATT2MAX ) # T = ATT1MAX + ATT2MAX # endif # # if ( (A1 = floor((T - BPT)/2)) < 0 ) # A1 = 0; # A2 = T; # else # if (A1 > ATT1MAX) # A1 = ATT1MAX; # endif # A2 = T - A1 # endif # # if ( A2 > ATT2MAX ) # A1 = A2-ATT2MAX # A2 = ATT2MAX # endif # # CA = CLAO + ATT1MAX + ATT2MAX - ATT # if ( CA < 0 ) # CA = 0 # else if ( CA > ACMAX ) # CA = ACMAX # endif # # Then, it writes three links: # HL2:SBPM:HL37:ATT1 = A1 # HL2:SBPM:HL37:ATT2 = A2 # HL2:SBPM:HL37:CALA = CA # record(sub, "HL2:SBPM:HL37:ATTC") { # Note: this record uses it's name to calculate # db link addresses to ATT1, ATT2, CALA field(DESC, "AFE Total Att. Calc.") # initialize fields to max. attenuation: # During init: # 1. hw initializes to max # 2. this record holds max # 3. PINI of the placeholder PVs (ATT, ATTO & friends) # trickle in and cause the total attenuation to # go down... field(A, "30") field(B, "0") field(C, "60") field(D, "20") field(EGU, "dB") field(INAM, "subAttIni") field(SNAM, "subAtt") } #propagate 'ACCESS.RVAL' state to #attenuator control #This record is unused in stdalone mode 'b' record(bo, "HL2:SBPM:HL37:ACTL") { field(DESC, "ATT OMSL Ctrl") field(DTYP, "Soft Channel") field(DOL, "HL2:SBPM:HL37:ACCESS.RVAL CP") field(OMSL, "closed_loop") field(OUT, "HL2:SBPM:HL37:ATT.OMSL PP") } ### ### Keep 'ATTO' and 'CLAO' on the main/VME IOC. ### It is more confusing but then we don't have ### to restore anything across reboots on the PAD ### IOC... ### ### This db now used for AFEs controlled by either ### a VME IOC or a PAD IOC. Use the same db for ### both for simplicity. ### ### NOTE: We could use the INPB / INPC ### links of ATTC directly but we DONT. ### Potentially, ATTC can be processed ### on every shot -- we don't want the ### links to be fetched every time for ### efficiency reasons. Hence the 'propagator' ### records which monitor ATTO/CLAO and ### write to ATTC.B ATTC.C only when ### necessary... record(longout, "HL2:SBPM:HL37:ATTOL") { field(DESC, "ATTO Propagator") field(DTYP, "Soft Channel") field(DOL, "HL2:SBPM:HL37:ATTO CP") field(OMSL, "closed_loop") field(OUT, "HL2:SBPM:HL37:ATTC.B PP") field(EGU, "dB") } record(longout, "HL2:SBPM:HL37:CLAOL") { field(DESC, "CLAO Propagator") field(DTYP, "Soft Channel") field(DOL, "HL2:SBPM:HL37:CLAO CP") field(OMSL, "closed_loop") field(OUT, "HL2:SBPM:HL37:ATTC.C PP") field(EGU, "dB") } record(calc, "HL2:SBPM:HL37:AFE_COMM_CALC") { field(DESC, "AFE communication error") field(SCAN, "10 second") field(CALC, "(A>0 && A<255)?1:0") field(INPA, "HL2:SBPM:HL37:VERS PP") field(FLNK, "HL2:SBPM:HL37:AFE_COMM") } record(bi, "HL2:SBPM:HL37:AFE_COMM") { field(DESC, "AFE communication error") field(INP, "HL2:SBPM:HL37:AFE_COMM_CALC") field(ZNAM, "Fault") field(ZSV, "MAJOR") field(ONAM, "Ok") } # Records only needed for RTM AFE record(longout, "HL2:SBPM:HL37:TRIG2BEAM") { field(DESC, "Trigger -> ADC trig") field(DTYP, "BusAddress") field(OUT, "#C0S0@AFE1+0x15,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVH, "255") field(PINI, "YES") info(autosaveFields, "VAL") } record(longout, "HL2:SBPM:HL37:RF2RED") { field(DESC, "Red RF -> ADC trig") field(DTYP, "BusAddress") field(OUT, "#C0S0@AFE1+0x16,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVH, "255") field(VAL, "6") field(PINI, "YES") info(autosaveFields, "VAL") } record(longout, "HL2:SBPM:HL37:RF2GRN") { field(DESC, "Grn RF -> ADC trig") field(DTYP, "BusAddress") field(OUT, "#C0S0@AFE1+0x17,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVH, "255") field(VAL, "6") field(PINI, "YES") info(autosaveFields, "VAL") } # bpmAfe.db; database for controlling stripline-BPM AFE # This database should not be loaded on PADs w/o AFE hardware. # # THIS FILE WAS GENERATED WITH msi FROM bpmPadAfe.template or bpmVmeDigiAfe.db AND EXPANDED FOR # # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # MODE: a -- Use VME IOC PVs # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # # NOTE: The template can be configured by means of proper macro # substitutions to # a) operate in 'normal' LCLS stripline BPM mode. In this # mode a few CA links to the VME/main IOC are active fetching # '$(dev):ACCESS', '$(dev):ATTO' and '$(dev):CLAO' from the # main IOC. # # b) standalone mode. In this mode, ACCESS is ignored and 'ATTO' and # 'CLAO' are instantiated / hosted on the PAD IOC. # # Mode 'a' is chosen by substituting # 'suffix' ='L', # 'propomsl' = 'closed_loop' # 'attomsl' = 'supervisory' # 'chrgL' = ' CPP' # 'actlL' = '$(dev):ACCESS.RVAL CP' # 'attoL' = '$(dev):ATTO CP' # 'claoL' = '$(dev):CLAO CP' # # Mode 'b' is chosen by substituting # 'suffix' = '' (empty) # 'propomsl' = 'supervisory' # 'attomsl' = 'supervisory' # 'chrgL' = '0' # 'actlL' = '0' # 'attoL' = '0' # 'claoL' = '0' # # SUBSTITUTIONS: # Substitutions available in main .db file # 'dev' : device name prefix # 'chrg' : name of global attenuator PV (for scaling all AFE attenuators with beam charge)(mode a) or '0' (mode b) # 'chrg' is only available in mode 'a'. # # Substitutions available in the template -- intended to be expanded when generating '.db' with MSI. # # 'chrgL' : name of global attenuator PV (for scaling all AFE attenuators with beam charge) + CPP attribute (mode a) or '0' (mode b) # 'actlL' : name of ACCESS.RVAL PV + CP attribute (mode a) or '0' (mode b) # 'attoL' : name of ATTO PV + CP attribute (mode a) or '0' (mode b) # 'claoL' : name of CLAO PV + CP attribute (mode a) or '0' (mode b) #'attomsl' : default/initial OMSL; if 'supervisory' then the 'ATT' PV controls attenuators # if 'closed_loop' then ATT is fetched from it's DOL (=='chrg' PV). # 'suffix' : see above. #'propomsl': see above. # # LINKS (pointing outside of this file): These links are only used in mode a and set to '0' in mode b. # HL2:SBPM:HL38:ATT.DOL <---- VIOC:GUN:BPM:ATTR CPP // DEFINED IN: [depends on 'chrg' macro substitution]. # HL2:SBPM:HL38:ACTL.DOL <---- HL2:SBPM:HL38:ACCESS.RVAL CP // DEFINED IN: associated main IOC database 'IOC--BPbpm.db' # HL2:SBPM:HL38:ATTOL.DOL<---- HL2:SBPM:HL38:ATTO CP // DEFINED IN: associated main IOC database 'IOC--BPbpm.db' # HL2:SBPM:HL38:CLAOL.DOL<---- HL2:SBPM:HL38:CLAO CP // DEFINED IN: associated main IOC database 'IOC--BPbpm.db' # # # # Additional macros added to support other architectures. These macros do NOT need to be populated for PAD AFEs # because the default value is set for them: # # instance - AFE identifier (0,1,... or identifying string) # devsup - device support name (qspiAfe for 'generic' suppport used by SLAC RTM and XTA AFE) # type - AFE flavor, 0 for PAD, 1 for XTA, 2 for RTM # record(longout, "HL2:SBPM:HL38:CALA") { field(DESC, "AFE Cal. Att.") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE2+1,qspiAfe") field(LOPR, "0") field(HOPR, "31") field(DRVL, "6") field(DRVH, "31") field(EGU, "dB") } record(longout, "HL2:SBPM:HL38:ATT1") { field(DESC, "AFE Att. 1") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE2+2,qspiAfe") field(LOPR, "0") field(HOPR, "15") field(DRVL, "0") field(DRVH, "15") field(EGU, "dB") } record(longout, "HL2:SBPM:HL38:ATT2") { field(DESC, "AFE Att. 2") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE2+3,qspiAfe") field(EGU, "dB") field(LOPR, "0") field(HOPR, "31") field(DRVL, "0") field(DRVH, "31") field(EGU, "dB") } # AFE FW versions (decimal): # 4 original LCLS-I FW version # >=32 ATT2 has 32 dB range; before 16 dB # 33 200 MHz board # 34 140 MHz board w/ 6dB PAD removed # 35 200 MHz board w/ 6dB PAD removed # > 64 140 MHz board not used with PAD/coldfire (XTA) # 8 MicroTCA RTM record(longin, "HL2:SBPM:HL38:VERS") { field(DESC, "AFE Firmware Vers.") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(INP, "#C0S0@AFE2+5,qspiAfe") field(LOLO, "3") field(LLSV, "MAJOR") } record(longout, "HL2:SBPM:HL38:AODL") { field(DESC, "Delay Trig -> AMP On") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE2+0x10,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVL, "255") } record(longout, "HL2:SBPM:HL38:R1DL") { field(DESC, "Delay AMP On -> RF1") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE2+0x11,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVL, "255") } record(longout, "HL2:SBPM:HL38:RFWD") { field(DESC, "RF Pulse Width") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE2+0x13,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVL, "255") info(autosaveFields, "VAL") } record(longout, "HL2:SBPM:HL38:OFFT") { field(DESC, "Delay RF Off -> Ctrl Sw.") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE2+0x14,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVL, "255") } record(longout, "HL2:SBPM:HL38:R2DL") { field(DESC, "Ctrl Sw. -> RF2") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE2+0x12,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVL, "255") } # This record just issues a CAL trigger record(longout, "HL2:SBPM:HL38:CALT") { field(DESC, "AFE CAL Soft Trigger") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE2+6,qspiAfe") } record(mbbo, "HL2:SBPM:HL38:CALM") { field(DESC, "AFE Cal. Mode") field(DTYP, "BusAddress") field(OUT, "#C0S0@AFE2+0,softTogAfe") field(NOBT, "2") field(SHFT, "0") field(ZRST, "CAL RED") field(ZRVL, "0") field(ONST, "CAL GRN") field(ONVL, "1") field(THST, "CAL NONE") field(THVL, "3") # 'soft toggle' mode. NOTE: LSB must match RED or GRN # which choses the mode to start with field(FRST, "CAL TOGGLE") field(FRVL, "4") field(VAL, "4") field(PINI, "YES") } # Subroutine to set up attenuator limits at ioc startup. # Attenuator ranges vary among AFE types and FW versions # This record also in bpmVmeDigiAfePart.db record(aSub, "HL2:SBPM:HL38:ATTINIT") { field(DESC, "Set up AFE att limits") field(PINI, "YES") field(SNAM, "subAttSetup") field(FTA, "LONG") field(INPA, "HL2:SBPM:HL38:VERS PP") field(FTVA, "LONG") field(OUTA, "HL2:SBPM:HL38:ATT1.HOPR") field(FTVB, "LONG") field(OUTB, "HL2:SBPM:HL38:ATT1.DRVH") field(FTVC, "LONG") field(OUTC, "HL2:SBPM:HL38:ATT2.HOPR") field(FTVD, "LONG") field(OUTD, "HL2:SBPM:HL38:ATT2.DRVH") field(FTVE, "LONG") field(OUTE, "HL2:SBPM:HL38:ATT.HOPR") field(FTVF, "LONG") field(OUTF, "HL2:SBPM:HL38:ATT.DRVH") field(FTVG, "LONG") field(OUTG, "HL2:SBPM:HL38:ATT.VAL") field(FTVH, "LONG") field(OUTH, "HL2:SBPM:HL38:ATTC.D") field(FTVI, "LONG") field(OUTI, "HL2:SBPM:HL38:ATTC.E") field(FTVJ, "LONG") field(OUTJ, "HL2:SBPM:HL38:ATTC.F") field(FTVK, "LONG") field(OUTK, "HL2:SBPM:HL38:ATTO.DRVL") field(FTVL, "LONG") field(OUTL, "HL2:SBPM:HL38:ATTO.LOPR") field(FTVM, "LONG") field(OUTM, "HL2:SBPM:HL38:ATTO.DRVH") field(FTVN, "LONG") field(OUTN, "HL2:SBPM:HL38:ATTO.HOPR") field(FTVO, "LONG") field(OUTO, "HL2:SBPM:HL38:CLAO.DRVL") field(FTVP, "LONG") field(OUTP, "HL2:SBPM:HL38:CLAO.LOPR") field(FTVQ, "LONG") field(OUTQ, "HL2:SBPM:HL38:CLAO.DRVH") field(FTVR, "LONG") field(OUTR, "HL2:SBPM:HL38:CLAO.HOPR") field(FLNK, "HL2:SBPM:HL38:ATT") } # Total attenuation (but ATTO is still added to this) record(longout, "HL2:SBPM:HL38:ATT") { field(DESC, "AFE Total Attenuation") field(OUT, "HL2:SBPM:HL38:ATTC.A PP") field(DRVL, "0") field(DRVH, "30") field(LOPR, "0") field(HOPR, "30") field(EGU, "dB") field(DOL, "VIOC:GUN:BPM:ATTR CPP") field(OMSL, "supervisory") field(VAL, "30") } # This subroutine record performs the # following operation (ATTC.D defines # the breakpoint where ATT1 kicks in # -- it depends on losses and gains: # BPT = G1 + L1 - L2 # with # G1: gain of 1st stage, # L1: loss + NF upstream of 1st stage, # L2: loss between 1st and 2nd stage + NF of 2nd stage # # if L1 : 2dB cable, 3dB 1st Filter, 1dB Att1 residual, 2.8dB NF = 8.8dB # L2 : 1dB Att2 residual, 4.5dB BPF, 3dB NF = 8.5dB # G1 : = 20.0dB # # -> breakpoint ~ 20dB # #----------------------------------------------------------------------------- # New RTM AFE characteristics are different (assume 140 ft LMR: 2.2db/100ft): # L1 : 3.1 dB cable, 4.5 dB 1st BPF, 1.1 dB att1, 3.3dB NF = 12.0dB # L2 : 1.1 dB att2, 2.7 dB NF, 1 dB BPF = 4.8dB # G1 : = 16.0dB # # -> breakpoint ~ 23dB # #----------------------------------------------------------------------------- # # Semantics of the different fields # A: Total attenuation (ATT records deposits value there) # B: ATTO # C: CLAO # D: BPT Breakpoint (see above) # E: (ATT1MAX) max. ATT1 attenuation (depends on version, set by ATTINIT) # F: (ATT2MAX) max. ATT2 attenuation (depends on version, set by ATTINIT) # # if ( (T=ATT+ATTO) > ATT1MAX + ATT2MAX ) # T = ATT1MAX + ATT2MAX # endif # # if ( (A1 = floor((T - BPT)/2)) < 0 ) # A1 = 0; # A2 = T; # else # if (A1 > ATT1MAX) # A1 = ATT1MAX; # endif # A2 = T - A1 # endif # # if ( A2 > ATT2MAX ) # A1 = A2-ATT2MAX # A2 = ATT2MAX # endif # # CA = CLAO + ATT1MAX + ATT2MAX - ATT # if ( CA < 0 ) # CA = 0 # else if ( CA > ACMAX ) # CA = ACMAX # endif # # Then, it writes three links: # HL2:SBPM:HL38:ATT1 = A1 # HL2:SBPM:HL38:ATT2 = A2 # HL2:SBPM:HL38:CALA = CA # record(sub, "HL2:SBPM:HL38:ATTC") { # Note: this record uses it's name to calculate # db link addresses to ATT1, ATT2, CALA field(DESC, "AFE Total Att. Calc.") # initialize fields to max. attenuation: # During init: # 1. hw initializes to max # 2. this record holds max # 3. PINI of the placeholder PVs (ATT, ATTO & friends) # trickle in and cause the total attenuation to # go down... field(A, "30") field(B, "0") field(C, "60") field(D, "20") field(EGU, "dB") field(INAM, "subAttIni") field(SNAM, "subAtt") } #propagate 'ACCESS.RVAL' state to #attenuator control #This record is unused in stdalone mode 'b' record(bo, "HL2:SBPM:HL38:ACTL") { field(DESC, "ATT OMSL Ctrl") field(DTYP, "Soft Channel") field(DOL, "HL2:SBPM:HL38:ACCESS.RVAL CP") field(OMSL, "closed_loop") field(OUT, "HL2:SBPM:HL38:ATT.OMSL PP") } ### ### Keep 'ATTO' and 'CLAO' on the main/VME IOC. ### It is more confusing but then we don't have ### to restore anything across reboots on the PAD ### IOC... ### ### This db now used for AFEs controlled by either ### a VME IOC or a PAD IOC. Use the same db for ### both for simplicity. ### ### NOTE: We could use the INPB / INPC ### links of ATTC directly but we DONT. ### Potentially, ATTC can be processed ### on every shot -- we don't want the ### links to be fetched every time for ### efficiency reasons. Hence the 'propagator' ### records which monitor ATTO/CLAO and ### write to ATTC.B ATTC.C only when ### necessary... record(longout, "HL2:SBPM:HL38:ATTOL") { field(DESC, "ATTO Propagator") field(DTYP, "Soft Channel") field(DOL, "HL2:SBPM:HL38:ATTO CP") field(OMSL, "closed_loop") field(OUT, "HL2:SBPM:HL38:ATTC.B PP") field(EGU, "dB") } record(longout, "HL2:SBPM:HL38:CLAOL") { field(DESC, "CLAO Propagator") field(DTYP, "Soft Channel") field(DOL, "HL2:SBPM:HL38:CLAO CP") field(OMSL, "closed_loop") field(OUT, "HL2:SBPM:HL38:ATTC.C PP") field(EGU, "dB") } record(calc, "HL2:SBPM:HL38:AFE_COMM_CALC") { field(DESC, "AFE communication error") field(SCAN, "10 second") field(CALC, "(A>0 && A<255)?1:0") field(INPA, "HL2:SBPM:HL38:VERS PP") field(FLNK, "HL2:SBPM:HL38:AFE_COMM") } record(bi, "HL2:SBPM:HL38:AFE_COMM") { field(DESC, "AFE communication error") field(INP, "HL2:SBPM:HL38:AFE_COMM_CALC") field(ZNAM, "Fault") field(ZSV, "MAJOR") field(ONAM, "Ok") } # Records only needed for RTM AFE record(longout, "HL2:SBPM:HL38:TRIG2BEAM") { field(DESC, "Trigger -> ADC trig") field(DTYP, "BusAddress") field(OUT, "#C0S0@AFE2+0x15,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVH, "255") field(PINI, "YES") info(autosaveFields, "VAL") } record(longout, "HL2:SBPM:HL38:RF2RED") { field(DESC, "Red RF -> ADC trig") field(DTYP, "BusAddress") field(OUT, "#C0S0@AFE2+0x16,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVH, "255") field(VAL, "6") field(PINI, "YES") info(autosaveFields, "VAL") } record(longout, "HL2:SBPM:HL38:RF2GRN") { field(DESC, "Grn RF -> ADC trig") field(DTYP, "BusAddress") field(OUT, "#C0S0@AFE2+0x17,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVH, "255") field(VAL, "6") field(PINI, "YES") info(autosaveFields, "VAL") } # bpmAfe.db; database for controlling stripline-BPM AFE # This database should not be loaded on PADs w/o AFE hardware. # # THIS FILE WAS GENERATED WITH msi FROM bpmPadAfe.template or bpmVmeDigiAfe.db AND EXPANDED FOR # # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # MODE: a -- Use VME IOC PVs # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # # NOTE: The template can be configured by means of proper macro # substitutions to # a) operate in 'normal' LCLS stripline BPM mode. In this # mode a few CA links to the VME/main IOC are active fetching # '$(dev):ACCESS', '$(dev):ATTO' and '$(dev):CLAO' from the # main IOC. # # b) standalone mode. In this mode, ACCESS is ignored and 'ATTO' and # 'CLAO' are instantiated / hosted on the PAD IOC. # # Mode 'a' is chosen by substituting # 'suffix' ='L', # 'propomsl' = 'closed_loop' # 'attomsl' = 'supervisory' # 'chrgL' = ' CPP' # 'actlL' = '$(dev):ACCESS.RVAL CP' # 'attoL' = '$(dev):ATTO CP' # 'claoL' = '$(dev):CLAO CP' # # Mode 'b' is chosen by substituting # 'suffix' = '' (empty) # 'propomsl' = 'supervisory' # 'attomsl' = 'supervisory' # 'chrgL' = '0' # 'actlL' = '0' # 'attoL' = '0' # 'claoL' = '0' # # SUBSTITUTIONS: # Substitutions available in main .db file # 'dev' : device name prefix # 'chrg' : name of global attenuator PV (for scaling all AFE attenuators with beam charge)(mode a) or '0' (mode b) # 'chrg' is only available in mode 'a'. # # Substitutions available in the template -- intended to be expanded when generating '.db' with MSI. # # 'chrgL' : name of global attenuator PV (for scaling all AFE attenuators with beam charge) + CPP attribute (mode a) or '0' (mode b) # 'actlL' : name of ACCESS.RVAL PV + CP attribute (mode a) or '0' (mode b) # 'attoL' : name of ATTO PV + CP attribute (mode a) or '0' (mode b) # 'claoL' : name of CLAO PV + CP attribute (mode a) or '0' (mode b) #'attomsl' : default/initial OMSL; if 'supervisory' then the 'ATT' PV controls attenuators # if 'closed_loop' then ATT is fetched from it's DOL (=='chrg' PV). # 'suffix' : see above. #'propomsl': see above. # # LINKS (pointing outside of this file): These links are only used in mode a and set to '0' in mode b. # HL3A:SBPM:HL39:ATT.DOL <---- VIOC:GUN:BPM:ATTR CPP // DEFINED IN: [depends on 'chrg' macro substitution]. # HL3A:SBPM:HL39:ACTL.DOL <---- HL3A:SBPM:HL39:ACCESS.RVAL CP // DEFINED IN: associated main IOC database 'IOC--BPbpm.db' # HL3A:SBPM:HL39:ATTOL.DOL<---- HL3A:SBPM:HL39:ATTO CP // DEFINED IN: associated main IOC database 'IOC--BPbpm.db' # HL3A:SBPM:HL39:CLAOL.DOL<---- HL3A:SBPM:HL39:CLAO CP // DEFINED IN: associated main IOC database 'IOC--BPbpm.db' # # # # Additional macros added to support other architectures. These macros do NOT need to be populated for PAD AFEs # because the default value is set for them: # # instance - AFE identifier (0,1,... or identifying string) # devsup - device support name (qspiAfe for 'generic' suppport used by SLAC RTM and XTA AFE) # type - AFE flavor, 0 for PAD, 1 for XTA, 2 for RTM # record(longout, "HL3A:SBPM:HL39:CALA") { field(DESC, "AFE Cal. Att.") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE3+1,qspiAfe") field(LOPR, "0") field(HOPR, "31") field(DRVL, "6") field(DRVH, "31") field(EGU, "dB") } record(longout, "HL3A:SBPM:HL39:ATT1") { field(DESC, "AFE Att. 1") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE3+2,qspiAfe") field(LOPR, "0") field(HOPR, "15") field(DRVL, "0") field(DRVH, "15") field(EGU, "dB") } record(longout, "HL3A:SBPM:HL39:ATT2") { field(DESC, "AFE Att. 2") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE3+3,qspiAfe") field(EGU, "dB") field(LOPR, "0") field(HOPR, "31") field(DRVL, "0") field(DRVH, "31") field(EGU, "dB") } # AFE FW versions (decimal): # 4 original LCLS-I FW version # >=32 ATT2 has 32 dB range; before 16 dB # 33 200 MHz board # 34 140 MHz board w/ 6dB PAD removed # 35 200 MHz board w/ 6dB PAD removed # > 64 140 MHz board not used with PAD/coldfire (XTA) # 8 MicroTCA RTM record(longin, "HL3A:SBPM:HL39:VERS") { field(DESC, "AFE Firmware Vers.") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(INP, "#C0S0@AFE3+5,qspiAfe") field(LOLO, "3") field(LLSV, "MAJOR") } record(longout, "HL3A:SBPM:HL39:AODL") { field(DESC, "Delay Trig -> AMP On") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE3+0x10,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVL, "255") } record(longout, "HL3A:SBPM:HL39:R1DL") { field(DESC, "Delay AMP On -> RF1") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE3+0x11,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVL, "255") } record(longout, "HL3A:SBPM:HL39:RFWD") { field(DESC, "RF Pulse Width") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE3+0x13,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVL, "255") info(autosaveFields, "VAL") } record(longout, "HL3A:SBPM:HL39:OFFT") { field(DESC, "Delay RF Off -> Ctrl Sw.") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE3+0x14,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVL, "255") } record(longout, "HL3A:SBPM:HL39:R2DL") { field(DESC, "Ctrl Sw. -> RF2") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE3+0x12,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVL, "255") } # This record just issues a CAL trigger record(longout, "HL3A:SBPM:HL39:CALT") { field(DESC, "AFE CAL Soft Trigger") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE3+6,qspiAfe") } record(mbbo, "HL3A:SBPM:HL39:CALM") { field(DESC, "AFE Cal. Mode") field(DTYP, "BusAddress") field(OUT, "#C0S0@AFE3+0,softTogAfe") field(NOBT, "2") field(SHFT, "0") field(ZRST, "CAL RED") field(ZRVL, "0") field(ONST, "CAL GRN") field(ONVL, "1") field(THST, "CAL NONE") field(THVL, "3") # 'soft toggle' mode. NOTE: LSB must match RED or GRN # which choses the mode to start with field(FRST, "CAL TOGGLE") field(FRVL, "4") field(VAL, "4") field(PINI, "YES") } # Subroutine to set up attenuator limits at ioc startup. # Attenuator ranges vary among AFE types and FW versions # This record also in bpmVmeDigiAfePart.db record(aSub, "HL3A:SBPM:HL39:ATTINIT") { field(DESC, "Set up AFE att limits") field(PINI, "YES") field(SNAM, "subAttSetup") field(FTA, "LONG") field(INPA, "HL3A:SBPM:HL39:VERS PP") field(FTVA, "LONG") field(OUTA, "HL3A:SBPM:HL39:ATT1.HOPR") field(FTVB, "LONG") field(OUTB, "HL3A:SBPM:HL39:ATT1.DRVH") field(FTVC, "LONG") field(OUTC, "HL3A:SBPM:HL39:ATT2.HOPR") field(FTVD, "LONG") field(OUTD, "HL3A:SBPM:HL39:ATT2.DRVH") field(FTVE, "LONG") field(OUTE, "HL3A:SBPM:HL39:ATT.HOPR") field(FTVF, "LONG") field(OUTF, "HL3A:SBPM:HL39:ATT.DRVH") field(FTVG, "LONG") field(OUTG, "HL3A:SBPM:HL39:ATT.VAL") field(FTVH, "LONG") field(OUTH, "HL3A:SBPM:HL39:ATTC.D") field(FTVI, "LONG") field(OUTI, "HL3A:SBPM:HL39:ATTC.E") field(FTVJ, "LONG") field(OUTJ, "HL3A:SBPM:HL39:ATTC.F") field(FTVK, "LONG") field(OUTK, "HL3A:SBPM:HL39:ATTO.DRVL") field(FTVL, "LONG") field(OUTL, "HL3A:SBPM:HL39:ATTO.LOPR") field(FTVM, "LONG") field(OUTM, "HL3A:SBPM:HL39:ATTO.DRVH") field(FTVN, "LONG") field(OUTN, "HL3A:SBPM:HL39:ATTO.HOPR") field(FTVO, "LONG") field(OUTO, "HL3A:SBPM:HL39:CLAO.DRVL") field(FTVP, "LONG") field(OUTP, "HL3A:SBPM:HL39:CLAO.LOPR") field(FTVQ, "LONG") field(OUTQ, "HL3A:SBPM:HL39:CLAO.DRVH") field(FTVR, "LONG") field(OUTR, "HL3A:SBPM:HL39:CLAO.HOPR") field(FLNK, "HL3A:SBPM:HL39:ATT") } # Total attenuation (but ATTO is still added to this) record(longout, "HL3A:SBPM:HL39:ATT") { field(DESC, "AFE Total Attenuation") field(OUT, "HL3A:SBPM:HL39:ATTC.A PP") field(DRVL, "0") field(DRVH, "30") field(LOPR, "0") field(HOPR, "30") field(EGU, "dB") field(DOL, "VIOC:GUN:BPM:ATTR CPP") field(OMSL, "supervisory") field(VAL, "30") } # This subroutine record performs the # following operation (ATTC.D defines # the breakpoint where ATT1 kicks in # -- it depends on losses and gains: # BPT = G1 + L1 - L2 # with # G1: gain of 1st stage, # L1: loss + NF upstream of 1st stage, # L2: loss between 1st and 2nd stage + NF of 2nd stage # # if L1 : 2dB cable, 3dB 1st Filter, 1dB Att1 residual, 2.8dB NF = 8.8dB # L2 : 1dB Att2 residual, 4.5dB BPF, 3dB NF = 8.5dB # G1 : = 20.0dB # # -> breakpoint ~ 20dB # #----------------------------------------------------------------------------- # New RTM AFE characteristics are different (assume 140 ft LMR: 2.2db/100ft): # L1 : 3.1 dB cable, 4.5 dB 1st BPF, 1.1 dB att1, 3.3dB NF = 12.0dB # L2 : 1.1 dB att2, 2.7 dB NF, 1 dB BPF = 4.8dB # G1 : = 16.0dB # # -> breakpoint ~ 23dB # #----------------------------------------------------------------------------- # # Semantics of the different fields # A: Total attenuation (ATT records deposits value there) # B: ATTO # C: CLAO # D: BPT Breakpoint (see above) # E: (ATT1MAX) max. ATT1 attenuation (depends on version, set by ATTINIT) # F: (ATT2MAX) max. ATT2 attenuation (depends on version, set by ATTINIT) # # if ( (T=ATT+ATTO) > ATT1MAX + ATT2MAX ) # T = ATT1MAX + ATT2MAX # endif # # if ( (A1 = floor((T - BPT)/2)) < 0 ) # A1 = 0; # A2 = T; # else # if (A1 > ATT1MAX) # A1 = ATT1MAX; # endif # A2 = T - A1 # endif # # if ( A2 > ATT2MAX ) # A1 = A2-ATT2MAX # A2 = ATT2MAX # endif # # CA = CLAO + ATT1MAX + ATT2MAX - ATT # if ( CA < 0 ) # CA = 0 # else if ( CA > ACMAX ) # CA = ACMAX # endif # # Then, it writes three links: # HL3A:SBPM:HL39:ATT1 = A1 # HL3A:SBPM:HL39:ATT2 = A2 # HL3A:SBPM:HL39:CALA = CA # record(sub, "HL3A:SBPM:HL39:ATTC") { # Note: this record uses it's name to calculate # db link addresses to ATT1, ATT2, CALA field(DESC, "AFE Total Att. Calc.") # initialize fields to max. attenuation: # During init: # 1. hw initializes to max # 2. this record holds max # 3. PINI of the placeholder PVs (ATT, ATTO & friends) # trickle in and cause the total attenuation to # go down... field(A, "30") field(B, "0") field(C, "60") field(D, "20") field(EGU, "dB") field(INAM, "subAttIni") field(SNAM, "subAtt") } #propagate 'ACCESS.RVAL' state to #attenuator control #This record is unused in stdalone mode 'b' record(bo, "HL3A:SBPM:HL39:ACTL") { field(DESC, "ATT OMSL Ctrl") field(DTYP, "Soft Channel") field(DOL, "HL3A:SBPM:HL39:ACCESS.RVAL CP") field(OMSL, "closed_loop") field(OUT, "HL3A:SBPM:HL39:ATT.OMSL PP") } ### ### Keep 'ATTO' and 'CLAO' on the main/VME IOC. ### It is more confusing but then we don't have ### to restore anything across reboots on the PAD ### IOC... ### ### This db now used for AFEs controlled by either ### a VME IOC or a PAD IOC. Use the same db for ### both for simplicity. ### ### NOTE: We could use the INPB / INPC ### links of ATTC directly but we DONT. ### Potentially, ATTC can be processed ### on every shot -- we don't want the ### links to be fetched every time for ### efficiency reasons. Hence the 'propagator' ### records which monitor ATTO/CLAO and ### write to ATTC.B ATTC.C only when ### necessary... record(longout, "HL3A:SBPM:HL39:ATTOL") { field(DESC, "ATTO Propagator") field(DTYP, "Soft Channel") field(DOL, "HL3A:SBPM:HL39:ATTO CP") field(OMSL, "closed_loop") field(OUT, "HL3A:SBPM:HL39:ATTC.B PP") field(EGU, "dB") } record(longout, "HL3A:SBPM:HL39:CLAOL") { field(DESC, "CLAO Propagator") field(DTYP, "Soft Channel") field(DOL, "HL3A:SBPM:HL39:CLAO CP") field(OMSL, "closed_loop") field(OUT, "HL3A:SBPM:HL39:ATTC.C PP") field(EGU, "dB") } record(calc, "HL3A:SBPM:HL39:AFE_COMM_CALC") { field(DESC, "AFE communication error") field(SCAN, "10 second") field(CALC, "(A>0 && A<255)?1:0") field(INPA, "HL3A:SBPM:HL39:VERS PP") field(FLNK, "HL3A:SBPM:HL39:AFE_COMM") } record(bi, "HL3A:SBPM:HL39:AFE_COMM") { field(DESC, "AFE communication error") field(INP, "HL3A:SBPM:HL39:AFE_COMM_CALC") field(ZNAM, "Fault") field(ZSV, "MAJOR") field(ONAM, "Ok") } # Records only needed for RTM AFE record(longout, "HL3A:SBPM:HL39:TRIG2BEAM") { field(DESC, "Trigger -> ADC trig") field(DTYP, "BusAddress") field(OUT, "#C0S0@AFE3+0x15,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVH, "255") field(PINI, "YES") info(autosaveFields, "VAL") } record(longout, "HL3A:SBPM:HL39:RF2RED") { field(DESC, "Red RF -> ADC trig") field(DTYP, "BusAddress") field(OUT, "#C0S0@AFE3+0x16,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVH, "255") field(VAL, "6") field(PINI, "YES") info(autosaveFields, "VAL") } record(longout, "HL3A:SBPM:HL39:RF2GRN") { field(DESC, "Grn RF -> ADC trig") field(DTYP, "BusAddress") field(OUT, "#C0S0@AFE3+0x17,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVH, "255") field(VAL, "6") field(PINI, "YES") info(autosaveFields, "VAL") } # bpmAfe.db; database for controlling stripline-BPM AFE # This database should not be loaded on PADs w/o AFE hardware. # # THIS FILE WAS GENERATED WITH msi FROM bpmPadAfe.template or bpmVmeDigiAfe.db AND EXPANDED FOR # # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # MODE: a -- Use VME IOC PVs # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # # NOTE: The template can be configured by means of proper macro # substitutions to # a) operate in 'normal' LCLS stripline BPM mode. In this # mode a few CA links to the VME/main IOC are active fetching # '$(dev):ACCESS', '$(dev):ATTO' and '$(dev):CLAO' from the # main IOC. # # b) standalone mode. In this mode, ACCESS is ignored and 'ATTO' and # 'CLAO' are instantiated / hosted on the PAD IOC. # # Mode 'a' is chosen by substituting # 'suffix' ='L', # 'propomsl' = 'closed_loop' # 'attomsl' = 'supervisory' # 'chrgL' = ' CPP' # 'actlL' = '$(dev):ACCESS.RVAL CP' # 'attoL' = '$(dev):ATTO CP' # 'claoL' = '$(dev):CLAO CP' # # Mode 'b' is chosen by substituting # 'suffix' = '' (empty) # 'propomsl' = 'supervisory' # 'attomsl' = 'supervisory' # 'chrgL' = '0' # 'actlL' = '0' # 'attoL' = '0' # 'claoL' = '0' # # SUBSTITUTIONS: # Substitutions available in main .db file # 'dev' : device name prefix # 'chrg' : name of global attenuator PV (for scaling all AFE attenuators with beam charge)(mode a) or '0' (mode b) # 'chrg' is only available in mode 'a'. # # Substitutions available in the template -- intended to be expanded when generating '.db' with MSI. # # 'chrgL' : name of global attenuator PV (for scaling all AFE attenuators with beam charge) + CPP attribute (mode a) or '0' (mode b) # 'actlL' : name of ACCESS.RVAL PV + CP attribute (mode a) or '0' (mode b) # 'attoL' : name of ATTO PV + CP attribute (mode a) or '0' (mode b) # 'claoL' : name of CLAO PV + CP attribute (mode a) or '0' (mode b) #'attomsl' : default/initial OMSL; if 'supervisory' then the 'ATT' PV controls attenuators # if 'closed_loop' then ATT is fetched from it's DOL (=='chrg' PV). # 'suffix' : see above. #'propomsl': see above. # # LINKS (pointing outside of this file): These links are only used in mode a and set to '0' in mode b. # HL3A:SBPM:HL40:ATT.DOL <---- VIOC:GUN:BPM:ATTR CPP // DEFINED IN: [depends on 'chrg' macro substitution]. # HL3A:SBPM:HL40:ACTL.DOL <---- HL3A:SBPM:HL40:ACCESS.RVAL CP // DEFINED IN: associated main IOC database 'IOC--BPbpm.db' # HL3A:SBPM:HL40:ATTOL.DOL<---- HL3A:SBPM:HL40:ATTO CP // DEFINED IN: associated main IOC database 'IOC--BPbpm.db' # HL3A:SBPM:HL40:CLAOL.DOL<---- HL3A:SBPM:HL40:CLAO CP // DEFINED IN: associated main IOC database 'IOC--BPbpm.db' # # # # Additional macros added to support other architectures. These macros do NOT need to be populated for PAD AFEs # because the default value is set for them: # # instance - AFE identifier (0,1,... or identifying string) # devsup - device support name (qspiAfe for 'generic' suppport used by SLAC RTM and XTA AFE) # type - AFE flavor, 0 for PAD, 1 for XTA, 2 for RTM # record(longout, "HL3A:SBPM:HL40:CALA") { field(DESC, "AFE Cal. Att.") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE4+1,qspiAfe") field(LOPR, "0") field(HOPR, "31") field(DRVL, "6") field(DRVH, "31") field(EGU, "dB") } record(longout, "HL3A:SBPM:HL40:ATT1") { field(DESC, "AFE Att. 1") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE4+2,qspiAfe") field(LOPR, "0") field(HOPR, "15") field(DRVL, "0") field(DRVH, "15") field(EGU, "dB") } record(longout, "HL3A:SBPM:HL40:ATT2") { field(DESC, "AFE Att. 2") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE4+3,qspiAfe") field(EGU, "dB") field(LOPR, "0") field(HOPR, "31") field(DRVL, "0") field(DRVH, "31") field(EGU, "dB") } # AFE FW versions (decimal): # 4 original LCLS-I FW version # >=32 ATT2 has 32 dB range; before 16 dB # 33 200 MHz board # 34 140 MHz board w/ 6dB PAD removed # 35 200 MHz board w/ 6dB PAD removed # > 64 140 MHz board not used with PAD/coldfire (XTA) # 8 MicroTCA RTM record(longin, "HL3A:SBPM:HL40:VERS") { field(DESC, "AFE Firmware Vers.") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(INP, "#C0S0@AFE4+5,qspiAfe") field(LOLO, "3") field(LLSV, "MAJOR") } record(longout, "HL3A:SBPM:HL40:AODL") { field(DESC, "Delay Trig -> AMP On") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE4+0x10,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVL, "255") } record(longout, "HL3A:SBPM:HL40:R1DL") { field(DESC, "Delay AMP On -> RF1") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE4+0x11,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVL, "255") } record(longout, "HL3A:SBPM:HL40:RFWD") { field(DESC, "RF Pulse Width") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE4+0x13,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVL, "255") info(autosaveFields, "VAL") } record(longout, "HL3A:SBPM:HL40:OFFT") { field(DESC, "Delay RF Off -> Ctrl Sw.") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE4+0x14,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVL, "255") } record(longout, "HL3A:SBPM:HL40:R2DL") { field(DESC, "Ctrl Sw. -> RF2") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE4+0x12,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVL, "255") } # This record just issues a CAL trigger record(longout, "HL3A:SBPM:HL40:CALT") { field(DESC, "AFE CAL Soft Trigger") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE4+6,qspiAfe") } record(mbbo, "HL3A:SBPM:HL40:CALM") { field(DESC, "AFE Cal. Mode") field(DTYP, "BusAddress") field(OUT, "#C0S0@AFE4+0,softTogAfe") field(NOBT, "2") field(SHFT, "0") field(ZRST, "CAL RED") field(ZRVL, "0") field(ONST, "CAL GRN") field(ONVL, "1") field(THST, "CAL NONE") field(THVL, "3") # 'soft toggle' mode. NOTE: LSB must match RED or GRN # which choses the mode to start with field(FRST, "CAL TOGGLE") field(FRVL, "4") field(VAL, "4") field(PINI, "YES") } # Subroutine to set up attenuator limits at ioc startup. # Attenuator ranges vary among AFE types and FW versions # This record also in bpmVmeDigiAfePart.db record(aSub, "HL3A:SBPM:HL40:ATTINIT") { field(DESC, "Set up AFE att limits") field(PINI, "YES") field(SNAM, "subAttSetup") field(FTA, "LONG") field(INPA, "HL3A:SBPM:HL40:VERS PP") field(FTVA, "LONG") field(OUTA, "HL3A:SBPM:HL40:ATT1.HOPR") field(FTVB, "LONG") field(OUTB, "HL3A:SBPM:HL40:ATT1.DRVH") field(FTVC, "LONG") field(OUTC, "HL3A:SBPM:HL40:ATT2.HOPR") field(FTVD, "LONG") field(OUTD, "HL3A:SBPM:HL40:ATT2.DRVH") field(FTVE, "LONG") field(OUTE, "HL3A:SBPM:HL40:ATT.HOPR") field(FTVF, "LONG") field(OUTF, "HL3A:SBPM:HL40:ATT.DRVH") field(FTVG, "LONG") field(OUTG, "HL3A:SBPM:HL40:ATT.VAL") field(FTVH, "LONG") field(OUTH, "HL3A:SBPM:HL40:ATTC.D") field(FTVI, "LONG") field(OUTI, "HL3A:SBPM:HL40:ATTC.E") field(FTVJ, "LONG") field(OUTJ, "HL3A:SBPM:HL40:ATTC.F") field(FTVK, "LONG") field(OUTK, "HL3A:SBPM:HL40:ATTO.DRVL") field(FTVL, "LONG") field(OUTL, "HL3A:SBPM:HL40:ATTO.LOPR") field(FTVM, "LONG") field(OUTM, "HL3A:SBPM:HL40:ATTO.DRVH") field(FTVN, "LONG") field(OUTN, "HL3A:SBPM:HL40:ATTO.HOPR") field(FTVO, "LONG") field(OUTO, "HL3A:SBPM:HL40:CLAO.DRVL") field(FTVP, "LONG") field(OUTP, "HL3A:SBPM:HL40:CLAO.LOPR") field(FTVQ, "LONG") field(OUTQ, "HL3A:SBPM:HL40:CLAO.DRVH") field(FTVR, "LONG") field(OUTR, "HL3A:SBPM:HL40:CLAO.HOPR") field(FLNK, "HL3A:SBPM:HL40:ATT") } # Total attenuation (but ATTO is still added to this) record(longout, "HL3A:SBPM:HL40:ATT") { field(DESC, "AFE Total Attenuation") field(OUT, "HL3A:SBPM:HL40:ATTC.A PP") field(DRVL, "0") field(DRVH, "30") field(LOPR, "0") field(HOPR, "30") field(EGU, "dB") field(DOL, "VIOC:GUN:BPM:ATTR CPP") field(OMSL, "supervisory") field(VAL, "30") } # This subroutine record performs the # following operation (ATTC.D defines # the breakpoint where ATT1 kicks in # -- it depends on losses and gains: # BPT = G1 + L1 - L2 # with # G1: gain of 1st stage, # L1: loss + NF upstream of 1st stage, # L2: loss between 1st and 2nd stage + NF of 2nd stage # # if L1 : 2dB cable, 3dB 1st Filter, 1dB Att1 residual, 2.8dB NF = 8.8dB # L2 : 1dB Att2 residual, 4.5dB BPF, 3dB NF = 8.5dB # G1 : = 20.0dB # # -> breakpoint ~ 20dB # #----------------------------------------------------------------------------- # New RTM AFE characteristics are different (assume 140 ft LMR: 2.2db/100ft): # L1 : 3.1 dB cable, 4.5 dB 1st BPF, 1.1 dB att1, 3.3dB NF = 12.0dB # L2 : 1.1 dB att2, 2.7 dB NF, 1 dB BPF = 4.8dB # G1 : = 16.0dB # # -> breakpoint ~ 23dB # #----------------------------------------------------------------------------- # # Semantics of the different fields # A: Total attenuation (ATT records deposits value there) # B: ATTO # C: CLAO # D: BPT Breakpoint (see above) # E: (ATT1MAX) max. ATT1 attenuation (depends on version, set by ATTINIT) # F: (ATT2MAX) max. ATT2 attenuation (depends on version, set by ATTINIT) # # if ( (T=ATT+ATTO) > ATT1MAX + ATT2MAX ) # T = ATT1MAX + ATT2MAX # endif # # if ( (A1 = floor((T - BPT)/2)) < 0 ) # A1 = 0; # A2 = T; # else # if (A1 > ATT1MAX) # A1 = ATT1MAX; # endif # A2 = T - A1 # endif # # if ( A2 > ATT2MAX ) # A1 = A2-ATT2MAX # A2 = ATT2MAX # endif # # CA = CLAO + ATT1MAX + ATT2MAX - ATT # if ( CA < 0 ) # CA = 0 # else if ( CA > ACMAX ) # CA = ACMAX # endif # # Then, it writes three links: # HL3A:SBPM:HL40:ATT1 = A1 # HL3A:SBPM:HL40:ATT2 = A2 # HL3A:SBPM:HL40:CALA = CA # record(sub, "HL3A:SBPM:HL40:ATTC") { # Note: this record uses it's name to calculate # db link addresses to ATT1, ATT2, CALA field(DESC, "AFE Total Att. Calc.") # initialize fields to max. attenuation: # During init: # 1. hw initializes to max # 2. this record holds max # 3. PINI of the placeholder PVs (ATT, ATTO & friends) # trickle in and cause the total attenuation to # go down... field(A, "30") field(B, "0") field(C, "60") field(D, "20") field(EGU, "dB") field(INAM, "subAttIni") field(SNAM, "subAtt") } #propagate 'ACCESS.RVAL' state to #attenuator control #This record is unused in stdalone mode 'b' record(bo, "HL3A:SBPM:HL40:ACTL") { field(DESC, "ATT OMSL Ctrl") field(DTYP, "Soft Channel") field(DOL, "HL3A:SBPM:HL40:ACCESS.RVAL CP") field(OMSL, "closed_loop") field(OUT, "HL3A:SBPM:HL40:ATT.OMSL PP") } ### ### Keep 'ATTO' and 'CLAO' on the main/VME IOC. ### It is more confusing but then we don't have ### to restore anything across reboots on the PAD ### IOC... ### ### This db now used for AFEs controlled by either ### a VME IOC or a PAD IOC. Use the same db for ### both for simplicity. ### ### NOTE: We could use the INPB / INPC ### links of ATTC directly but we DONT. ### Potentially, ATTC can be processed ### on every shot -- we don't want the ### links to be fetched every time for ### efficiency reasons. Hence the 'propagator' ### records which monitor ATTO/CLAO and ### write to ATTC.B ATTC.C only when ### necessary... record(longout, "HL3A:SBPM:HL40:ATTOL") { field(DESC, "ATTO Propagator") field(DTYP, "Soft Channel") field(DOL, "HL3A:SBPM:HL40:ATTO CP") field(OMSL, "closed_loop") field(OUT, "HL3A:SBPM:HL40:ATTC.B PP") field(EGU, "dB") } record(longout, "HL3A:SBPM:HL40:CLAOL") { field(DESC, "CLAO Propagator") field(DTYP, "Soft Channel") field(DOL, "HL3A:SBPM:HL40:CLAO CP") field(OMSL, "closed_loop") field(OUT, "HL3A:SBPM:HL40:ATTC.C PP") field(EGU, "dB") } record(calc, "HL3A:SBPM:HL40:AFE_COMM_CALC") { field(DESC, "AFE communication error") field(SCAN, "10 second") field(CALC, "(A>0 && A<255)?1:0") field(INPA, "HL3A:SBPM:HL40:VERS PP") field(FLNK, "HL3A:SBPM:HL40:AFE_COMM") } record(bi, "HL3A:SBPM:HL40:AFE_COMM") { field(DESC, "AFE communication error") field(INP, "HL3A:SBPM:HL40:AFE_COMM_CALC") field(ZNAM, "Fault") field(ZSV, "MAJOR") field(ONAM, "Ok") } # Records only needed for RTM AFE record(longout, "HL3A:SBPM:HL40:TRIG2BEAM") { field(DESC, "Trigger -> ADC trig") field(DTYP, "BusAddress") field(OUT, "#C0S0@AFE4+0x15,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVH, "255") field(PINI, "YES") info(autosaveFields, "VAL") } record(longout, "HL3A:SBPM:HL40:RF2RED") { field(DESC, "Red RF -> ADC trig") field(DTYP, "BusAddress") field(OUT, "#C0S0@AFE4+0x16,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVH, "255") field(VAL, "6") field(PINI, "YES") info(autosaveFields, "VAL") } record(longout, "HL3A:SBPM:HL40:RF2GRN") { field(DESC, "Grn RF -> ADC trig") field(DTYP, "BusAddress") field(OUT, "#C0S0@AFE4+0x17,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVH, "255") field(VAL, "6") field(PINI, "YES") info(autosaveFields, "VAL") } # bpmAfe.db; database for controlling stripline-BPM AFE # This database should not be loaded on PADs w/o AFE hardware. # # THIS FILE WAS GENERATED WITH msi FROM bpmPadAfe.template or bpmVmeDigiAfe.db AND EXPANDED FOR # # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # MODE: a -- Use VME IOC PVs # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # # NOTE: The template can be configured by means of proper macro # substitutions to # a) operate in 'normal' LCLS stripline BPM mode. In this # mode a few CA links to the VME/main IOC are active fetching # '$(dev):ACCESS', '$(dev):ATTO' and '$(dev):CLAO' from the # main IOC. # # b) standalone mode. In this mode, ACCESS is ignored and 'ATTO' and # 'CLAO' are instantiated / hosted on the PAD IOC. # # Mode 'a' is chosen by substituting # 'suffix' ='L', # 'propomsl' = 'closed_loop' # 'attomsl' = 'supervisory' # 'chrgL' = ' CPP' # 'actlL' = '$(dev):ACCESS.RVAL CP' # 'attoL' = '$(dev):ATTO CP' # 'claoL' = '$(dev):CLAO CP' # # Mode 'b' is chosen by substituting # 'suffix' = '' (empty) # 'propomsl' = 'supervisory' # 'attomsl' = 'supervisory' # 'chrgL' = '0' # 'actlL' = '0' # 'attoL' = '0' # 'claoL' = '0' # # SUBSTITUTIONS: # Substitutions available in main .db file # 'dev' : device name prefix # 'chrg' : name of global attenuator PV (for scaling all AFE attenuators with beam charge)(mode a) or '0' (mode b) # 'chrg' is only available in mode 'a'. # # Substitutions available in the template -- intended to be expanded when generating '.db' with MSI. # # 'chrgL' : name of global attenuator PV (for scaling all AFE attenuators with beam charge) + CPP attribute (mode a) or '0' (mode b) # 'actlL' : name of ACCESS.RVAL PV + CP attribute (mode a) or '0' (mode b) # 'attoL' : name of ATTO PV + CP attribute (mode a) or '0' (mode b) # 'claoL' : name of CLAO PV + CP attribute (mode a) or '0' (mode b) #'attomsl' : default/initial OMSL; if 'supervisory' then the 'ATT' PV controls attenuators # if 'closed_loop' then ATT is fetched from it's DOL (=='chrg' PV). # 'suffix' : see above. #'propomsl': see above. # # LINKS (pointing outside of this file): These links are only used in mode a and set to '0' in mode b. # HL3A:SBPM:HL41:ATT.DOL <---- VIOC:GUN:BPM:ATTR CPP // DEFINED IN: [depends on 'chrg' macro substitution]. # HL3A:SBPM:HL41:ACTL.DOL <---- HL3A:SBPM:HL41:ACCESS.RVAL CP // DEFINED IN: associated main IOC database 'IOC--BPbpm.db' # HL3A:SBPM:HL41:ATTOL.DOL<---- HL3A:SBPM:HL41:ATTO CP // DEFINED IN: associated main IOC database 'IOC--BPbpm.db' # HL3A:SBPM:HL41:CLAOL.DOL<---- HL3A:SBPM:HL41:CLAO CP // DEFINED IN: associated main IOC database 'IOC--BPbpm.db' # # # # Additional macros added to support other architectures. These macros do NOT need to be populated for PAD AFEs # because the default value is set for them: # # instance - AFE identifier (0,1,... or identifying string) # devsup - device support name (qspiAfe for 'generic' suppport used by SLAC RTM and XTA AFE) # type - AFE flavor, 0 for PAD, 1 for XTA, 2 for RTM # record(longout, "HL3A:SBPM:HL41:CALA") { field(DESC, "AFE Cal. Att.") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE5+1,qspiAfe") field(LOPR, "0") field(HOPR, "31") field(DRVL, "6") field(DRVH, "31") field(EGU, "dB") } record(longout, "HL3A:SBPM:HL41:ATT1") { field(DESC, "AFE Att. 1") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE5+2,qspiAfe") field(LOPR, "0") field(HOPR, "15") field(DRVL, "0") field(DRVH, "15") field(EGU, "dB") } record(longout, "HL3A:SBPM:HL41:ATT2") { field(DESC, "AFE Att. 2") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE5+3,qspiAfe") field(EGU, "dB") field(LOPR, "0") field(HOPR, "31") field(DRVL, "0") field(DRVH, "31") field(EGU, "dB") } # AFE FW versions (decimal): # 4 original LCLS-I FW version # >=32 ATT2 has 32 dB range; before 16 dB # 33 200 MHz board # 34 140 MHz board w/ 6dB PAD removed # 35 200 MHz board w/ 6dB PAD removed # > 64 140 MHz board not used with PAD/coldfire (XTA) # 8 MicroTCA RTM record(longin, "HL3A:SBPM:HL41:VERS") { field(DESC, "AFE Firmware Vers.") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(INP, "#C0S0@AFE5+5,qspiAfe") field(LOLO, "3") field(LLSV, "MAJOR") } record(longout, "HL3A:SBPM:HL41:AODL") { field(DESC, "Delay Trig -> AMP On") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE5+0x10,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVL, "255") } record(longout, "HL3A:SBPM:HL41:R1DL") { field(DESC, "Delay AMP On -> RF1") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE5+0x11,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVL, "255") } record(longout, "HL3A:SBPM:HL41:RFWD") { field(DESC, "RF Pulse Width") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE5+0x13,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVL, "255") info(autosaveFields, "VAL") } record(longout, "HL3A:SBPM:HL41:OFFT") { field(DESC, "Delay RF Off -> Ctrl Sw.") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE5+0x14,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVL, "255") } record(longout, "HL3A:SBPM:HL41:R2DL") { field(DESC, "Ctrl Sw. -> RF2") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE5+0x12,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVL, "255") } # This record just issues a CAL trigger record(longout, "HL3A:SBPM:HL41:CALT") { field(DESC, "AFE CAL Soft Trigger") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE5+6,qspiAfe") } record(mbbo, "HL3A:SBPM:HL41:CALM") { field(DESC, "AFE Cal. Mode") field(DTYP, "BusAddress") field(OUT, "#C0S0@AFE5+0,softTogAfe") field(NOBT, "2") field(SHFT, "0") field(ZRST, "CAL RED") field(ZRVL, "0") field(ONST, "CAL GRN") field(ONVL, "1") field(THST, "CAL NONE") field(THVL, "3") # 'soft toggle' mode. NOTE: LSB must match RED or GRN # which choses the mode to start with field(FRST, "CAL TOGGLE") field(FRVL, "4") field(VAL, "4") field(PINI, "YES") } # Subroutine to set up attenuator limits at ioc startup. # Attenuator ranges vary among AFE types and FW versions # This record also in bpmVmeDigiAfePart.db record(aSub, "HL3A:SBPM:HL41:ATTINIT") { field(DESC, "Set up AFE att limits") field(PINI, "YES") field(SNAM, "subAttSetup") field(FTA, "LONG") field(INPA, "HL3A:SBPM:HL41:VERS PP") field(FTVA, "LONG") field(OUTA, "HL3A:SBPM:HL41:ATT1.HOPR") field(FTVB, "LONG") field(OUTB, "HL3A:SBPM:HL41:ATT1.DRVH") field(FTVC, "LONG") field(OUTC, "HL3A:SBPM:HL41:ATT2.HOPR") field(FTVD, "LONG") field(OUTD, "HL3A:SBPM:HL41:ATT2.DRVH") field(FTVE, "LONG") field(OUTE, "HL3A:SBPM:HL41:ATT.HOPR") field(FTVF, "LONG") field(OUTF, "HL3A:SBPM:HL41:ATT.DRVH") field(FTVG, "LONG") field(OUTG, "HL3A:SBPM:HL41:ATT.VAL") field(FTVH, "LONG") field(OUTH, "HL3A:SBPM:HL41:ATTC.D") field(FTVI, "LONG") field(OUTI, "HL3A:SBPM:HL41:ATTC.E") field(FTVJ, "LONG") field(OUTJ, "HL3A:SBPM:HL41:ATTC.F") field(FTVK, "LONG") field(OUTK, "HL3A:SBPM:HL41:ATTO.DRVL") field(FTVL, "LONG") field(OUTL, "HL3A:SBPM:HL41:ATTO.LOPR") field(FTVM, "LONG") field(OUTM, "HL3A:SBPM:HL41:ATTO.DRVH") field(FTVN, "LONG") field(OUTN, "HL3A:SBPM:HL41:ATTO.HOPR") field(FTVO, "LONG") field(OUTO, "HL3A:SBPM:HL41:CLAO.DRVL") field(FTVP, "LONG") field(OUTP, "HL3A:SBPM:HL41:CLAO.LOPR") field(FTVQ, "LONG") field(OUTQ, "HL3A:SBPM:HL41:CLAO.DRVH") field(FTVR, "LONG") field(OUTR, "HL3A:SBPM:HL41:CLAO.HOPR") field(FLNK, "HL3A:SBPM:HL41:ATT") } # Total attenuation (but ATTO is still added to this) record(longout, "HL3A:SBPM:HL41:ATT") { field(DESC, "AFE Total Attenuation") field(OUT, "HL3A:SBPM:HL41:ATTC.A PP") field(DRVL, "0") field(DRVH, "30") field(LOPR, "0") field(HOPR, "30") field(EGU, "dB") field(DOL, "VIOC:GUN:BPM:ATTR CPP") field(OMSL, "supervisory") field(VAL, "30") } # This subroutine record performs the # following operation (ATTC.D defines # the breakpoint where ATT1 kicks in # -- it depends on losses and gains: # BPT = G1 + L1 - L2 # with # G1: gain of 1st stage, # L1: loss + NF upstream of 1st stage, # L2: loss between 1st and 2nd stage + NF of 2nd stage # # if L1 : 2dB cable, 3dB 1st Filter, 1dB Att1 residual, 2.8dB NF = 8.8dB # L2 : 1dB Att2 residual, 4.5dB BPF, 3dB NF = 8.5dB # G1 : = 20.0dB # # -> breakpoint ~ 20dB # #----------------------------------------------------------------------------- # New RTM AFE characteristics are different (assume 140 ft LMR: 2.2db/100ft): # L1 : 3.1 dB cable, 4.5 dB 1st BPF, 1.1 dB att1, 3.3dB NF = 12.0dB # L2 : 1.1 dB att2, 2.7 dB NF, 1 dB BPF = 4.8dB # G1 : = 16.0dB # # -> breakpoint ~ 23dB # #----------------------------------------------------------------------------- # # Semantics of the different fields # A: Total attenuation (ATT records deposits value there) # B: ATTO # C: CLAO # D: BPT Breakpoint (see above) # E: (ATT1MAX) max. ATT1 attenuation (depends on version, set by ATTINIT) # F: (ATT2MAX) max. ATT2 attenuation (depends on version, set by ATTINIT) # # if ( (T=ATT+ATTO) > ATT1MAX + ATT2MAX ) # T = ATT1MAX + ATT2MAX # endif # # if ( (A1 = floor((T - BPT)/2)) < 0 ) # A1 = 0; # A2 = T; # else # if (A1 > ATT1MAX) # A1 = ATT1MAX; # endif # A2 = T - A1 # endif # # if ( A2 > ATT2MAX ) # A1 = A2-ATT2MAX # A2 = ATT2MAX # endif # # CA = CLAO + ATT1MAX + ATT2MAX - ATT # if ( CA < 0 ) # CA = 0 # else if ( CA > ACMAX ) # CA = ACMAX # endif # # Then, it writes three links: # HL3A:SBPM:HL41:ATT1 = A1 # HL3A:SBPM:HL41:ATT2 = A2 # HL3A:SBPM:HL41:CALA = CA # record(sub, "HL3A:SBPM:HL41:ATTC") { # Note: this record uses it's name to calculate # db link addresses to ATT1, ATT2, CALA field(DESC, "AFE Total Att. Calc.") # initialize fields to max. attenuation: # During init: # 1. hw initializes to max # 2. this record holds max # 3. PINI of the placeholder PVs (ATT, ATTO & friends) # trickle in and cause the total attenuation to # go down... field(A, "30") field(B, "0") field(C, "60") field(D, "20") field(EGU, "dB") field(INAM, "subAttIni") field(SNAM, "subAtt") } #propagate 'ACCESS.RVAL' state to #attenuator control #This record is unused in stdalone mode 'b' record(bo, "HL3A:SBPM:HL41:ACTL") { field(DESC, "ATT OMSL Ctrl") field(DTYP, "Soft Channel") field(DOL, "HL3A:SBPM:HL41:ACCESS.RVAL CP") field(OMSL, "closed_loop") field(OUT, "HL3A:SBPM:HL41:ATT.OMSL PP") } ### ### Keep 'ATTO' and 'CLAO' on the main/VME IOC. ### It is more confusing but then we don't have ### to restore anything across reboots on the PAD ### IOC... ### ### This db now used for AFEs controlled by either ### a VME IOC or a PAD IOC. Use the same db for ### both for simplicity. ### ### NOTE: We could use the INPB / INPC ### links of ATTC directly but we DONT. ### Potentially, ATTC can be processed ### on every shot -- we don't want the ### links to be fetched every time for ### efficiency reasons. Hence the 'propagator' ### records which monitor ATTO/CLAO and ### write to ATTC.B ATTC.C only when ### necessary... record(longout, "HL3A:SBPM:HL41:ATTOL") { field(DESC, "ATTO Propagator") field(DTYP, "Soft Channel") field(DOL, "HL3A:SBPM:HL41:ATTO CP") field(OMSL, "closed_loop") field(OUT, "HL3A:SBPM:HL41:ATTC.B PP") field(EGU, "dB") } record(longout, "HL3A:SBPM:HL41:CLAOL") { field(DESC, "CLAO Propagator") field(DTYP, "Soft Channel") field(DOL, "HL3A:SBPM:HL41:CLAO CP") field(OMSL, "closed_loop") field(OUT, "HL3A:SBPM:HL41:ATTC.C PP") field(EGU, "dB") } record(calc, "HL3A:SBPM:HL41:AFE_COMM_CALC") { field(DESC, "AFE communication error") field(SCAN, "10 second") field(CALC, "(A>0 && A<255)?1:0") field(INPA, "HL3A:SBPM:HL41:VERS PP") field(FLNK, "HL3A:SBPM:HL41:AFE_COMM") } record(bi, "HL3A:SBPM:HL41:AFE_COMM") { field(DESC, "AFE communication error") field(INP, "HL3A:SBPM:HL41:AFE_COMM_CALC") field(ZNAM, "Fault") field(ZSV, "MAJOR") field(ONAM, "Ok") } # Records only needed for RTM AFE record(longout, "HL3A:SBPM:HL41:TRIG2BEAM") { field(DESC, "Trigger -> ADC trig") field(DTYP, "BusAddress") field(OUT, "#C0S0@AFE5+0x15,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVH, "255") field(PINI, "YES") info(autosaveFields, "VAL") } record(longout, "HL3A:SBPM:HL41:RF2RED") { field(DESC, "Red RF -> ADC trig") field(DTYP, "BusAddress") field(OUT, "#C0S0@AFE5+0x16,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVH, "255") field(VAL, "6") field(PINI, "YES") info(autosaveFields, "VAL") } record(longout, "HL3A:SBPM:HL41:RF2GRN") { field(DESC, "Grn RF -> ADC trig") field(DTYP, "BusAddress") field(OUT, "#C0S0@AFE5+0x17,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVH, "255") field(VAL, "6") field(PINI, "YES") info(autosaveFields, "VAL") } # bpmAfe.db; database for controlling stripline-BPM AFE # This database should not be loaded on PADs w/o AFE hardware. # # THIS FILE WAS GENERATED WITH msi FROM bpmPadAfe.template or bpmVmeDigiAfe.db AND EXPANDED FOR # # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # MODE: a -- Use VME IOC PVs # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # # NOTE: The template can be configured by means of proper macro # substitutions to # a) operate in 'normal' LCLS stripline BPM mode. In this # mode a few CA links to the VME/main IOC are active fetching # '$(dev):ACCESS', '$(dev):ATTO' and '$(dev):CLAO' from the # main IOC. # # b) standalone mode. In this mode, ACCESS is ignored and 'ATTO' and # 'CLAO' are instantiated / hosted on the PAD IOC. # # Mode 'a' is chosen by substituting # 'suffix' ='L', # 'propomsl' = 'closed_loop' # 'attomsl' = 'supervisory' # 'chrgL' = ' CPP' # 'actlL' = '$(dev):ACCESS.RVAL CP' # 'attoL' = '$(dev):ATTO CP' # 'claoL' = '$(dev):CLAO CP' # # Mode 'b' is chosen by substituting # 'suffix' = '' (empty) # 'propomsl' = 'supervisory' # 'attomsl' = 'supervisory' # 'chrgL' = '0' # 'actlL' = '0' # 'attoL' = '0' # 'claoL' = '0' # # SUBSTITUTIONS: # Substitutions available in main .db file # 'dev' : device name prefix # 'chrg' : name of global attenuator PV (for scaling all AFE attenuators with beam charge)(mode a) or '0' (mode b) # 'chrg' is only available in mode 'a'. # # Substitutions available in the template -- intended to be expanded when generating '.db' with MSI. # # 'chrgL' : name of global attenuator PV (for scaling all AFE attenuators with beam charge) + CPP attribute (mode a) or '0' (mode b) # 'actlL' : name of ACCESS.RVAL PV + CP attribute (mode a) or '0' (mode b) # 'attoL' : name of ATTO PV + CP attribute (mode a) or '0' (mode b) # 'claoL' : name of CLAO PV + CP attribute (mode a) or '0' (mode b) #'attomsl' : default/initial OMSL; if 'supervisory' then the 'ATT' PV controls attenuators # if 'closed_loop' then ATT is fetched from it's DOL (=='chrg' PV). # 'suffix' : see above. #'propomsl': see above. # # LINKS (pointing outside of this file): These links are only used in mode a and set to '0' in mode b. # HL3A:SBPM:HL42:ATT.DOL <---- VIOC:GUN:BPM:ATTR CPP // DEFINED IN: [depends on 'chrg' macro substitution]. # HL3A:SBPM:HL42:ACTL.DOL <---- HL3A:SBPM:HL42:ACCESS.RVAL CP // DEFINED IN: associated main IOC database 'IOC--BPbpm.db' # HL3A:SBPM:HL42:ATTOL.DOL<---- HL3A:SBPM:HL42:ATTO CP // DEFINED IN: associated main IOC database 'IOC--BPbpm.db' # HL3A:SBPM:HL42:CLAOL.DOL<---- HL3A:SBPM:HL42:CLAO CP // DEFINED IN: associated main IOC database 'IOC--BPbpm.db' # # # # Additional macros added to support other architectures. These macros do NOT need to be populated for PAD AFEs # because the default value is set for them: # # instance - AFE identifier (0,1,... or identifying string) # devsup - device support name (qspiAfe for 'generic' suppport used by SLAC RTM and XTA AFE) # type - AFE flavor, 0 for PAD, 1 for XTA, 2 for RTM # record(longout, "HL3A:SBPM:HL42:CALA") { field(DESC, "AFE Cal. Att.") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE6+1,qspiAfe") field(LOPR, "0") field(HOPR, "31") field(DRVL, "6") field(DRVH, "31") field(EGU, "dB") } record(longout, "HL3A:SBPM:HL42:ATT1") { field(DESC, "AFE Att. 1") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE6+2,qspiAfe") field(LOPR, "0") field(HOPR, "15") field(DRVL, "0") field(DRVH, "15") field(EGU, "dB") } record(longout, "HL3A:SBPM:HL42:ATT2") { field(DESC, "AFE Att. 2") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE6+3,qspiAfe") field(EGU, "dB") field(LOPR, "0") field(HOPR, "31") field(DRVL, "0") field(DRVH, "31") field(EGU, "dB") } # AFE FW versions (decimal): # 4 original LCLS-I FW version # >=32 ATT2 has 32 dB range; before 16 dB # 33 200 MHz board # 34 140 MHz board w/ 6dB PAD removed # 35 200 MHz board w/ 6dB PAD removed # > 64 140 MHz board not used with PAD/coldfire (XTA) # 8 MicroTCA RTM record(longin, "HL3A:SBPM:HL42:VERS") { field(DESC, "AFE Firmware Vers.") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(INP, "#C0S0@AFE6+5,qspiAfe") field(LOLO, "3") field(LLSV, "MAJOR") } record(longout, "HL3A:SBPM:HL42:AODL") { field(DESC, "Delay Trig -> AMP On") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE6+0x10,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVL, "255") } record(longout, "HL3A:SBPM:HL42:R1DL") { field(DESC, "Delay AMP On -> RF1") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE6+0x11,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVL, "255") } record(longout, "HL3A:SBPM:HL42:RFWD") { field(DESC, "RF Pulse Width") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE6+0x13,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVL, "255") info(autosaveFields, "VAL") } record(longout, "HL3A:SBPM:HL42:OFFT") { field(DESC, "Delay RF Off -> Ctrl Sw.") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE6+0x14,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVL, "255") } record(longout, "HL3A:SBPM:HL42:R2DL") { field(DESC, "Ctrl Sw. -> RF2") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE6+0x12,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVL, "255") } # This record just issues a CAL trigger record(longout, "HL3A:SBPM:HL42:CALT") { field(DESC, "AFE CAL Soft Trigger") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE6+6,qspiAfe") } record(mbbo, "HL3A:SBPM:HL42:CALM") { field(DESC, "AFE Cal. Mode") field(DTYP, "BusAddress") field(OUT, "#C0S0@AFE6+0,softTogAfe") field(NOBT, "2") field(SHFT, "0") field(ZRST, "CAL RED") field(ZRVL, "0") field(ONST, "CAL GRN") field(ONVL, "1") field(THST, "CAL NONE") field(THVL, "3") # 'soft toggle' mode. NOTE: LSB must match RED or GRN # which choses the mode to start with field(FRST, "CAL TOGGLE") field(FRVL, "4") field(VAL, "4") field(PINI, "YES") } # Subroutine to set up attenuator limits at ioc startup. # Attenuator ranges vary among AFE types and FW versions # This record also in bpmVmeDigiAfePart.db record(aSub, "HL3A:SBPM:HL42:ATTINIT") { field(DESC, "Set up AFE att limits") field(PINI, "YES") field(SNAM, "subAttSetup") field(FTA, "LONG") field(INPA, "HL3A:SBPM:HL42:VERS PP") field(FTVA, "LONG") field(OUTA, "HL3A:SBPM:HL42:ATT1.HOPR") field(FTVB, "LONG") field(OUTB, "HL3A:SBPM:HL42:ATT1.DRVH") field(FTVC, "LONG") field(OUTC, "HL3A:SBPM:HL42:ATT2.HOPR") field(FTVD, "LONG") field(OUTD, "HL3A:SBPM:HL42:ATT2.DRVH") field(FTVE, "LONG") field(OUTE, "HL3A:SBPM:HL42:ATT.HOPR") field(FTVF, "LONG") field(OUTF, "HL3A:SBPM:HL42:ATT.DRVH") field(FTVG, "LONG") field(OUTG, "HL3A:SBPM:HL42:ATT.VAL") field(FTVH, "LONG") field(OUTH, "HL3A:SBPM:HL42:ATTC.D") field(FTVI, "LONG") field(OUTI, "HL3A:SBPM:HL42:ATTC.E") field(FTVJ, "LONG") field(OUTJ, "HL3A:SBPM:HL42:ATTC.F") field(FTVK, "LONG") field(OUTK, "HL3A:SBPM:HL42:ATTO.DRVL") field(FTVL, "LONG") field(OUTL, "HL3A:SBPM:HL42:ATTO.LOPR") field(FTVM, "LONG") field(OUTM, "HL3A:SBPM:HL42:ATTO.DRVH") field(FTVN, "LONG") field(OUTN, "HL3A:SBPM:HL42:ATTO.HOPR") field(FTVO, "LONG") field(OUTO, "HL3A:SBPM:HL42:CLAO.DRVL") field(FTVP, "LONG") field(OUTP, "HL3A:SBPM:HL42:CLAO.LOPR") field(FTVQ, "LONG") field(OUTQ, "HL3A:SBPM:HL42:CLAO.DRVH") field(FTVR, "LONG") field(OUTR, "HL3A:SBPM:HL42:CLAO.HOPR") field(FLNK, "HL3A:SBPM:HL42:ATT") } # Total attenuation (but ATTO is still added to this) record(longout, "HL3A:SBPM:HL42:ATT") { field(DESC, "AFE Total Attenuation") field(OUT, "HL3A:SBPM:HL42:ATTC.A PP") field(DRVL, "0") field(DRVH, "30") field(LOPR, "0") field(HOPR, "30") field(EGU, "dB") field(DOL, "VIOC:GUN:BPM:ATTR CPP") field(OMSL, "supervisory") field(VAL, "30") } # This subroutine record performs the # following operation (ATTC.D defines # the breakpoint where ATT1 kicks in # -- it depends on losses and gains: # BPT = G1 + L1 - L2 # with # G1: gain of 1st stage, # L1: loss + NF upstream of 1st stage, # L2: loss between 1st and 2nd stage + NF of 2nd stage # # if L1 : 2dB cable, 3dB 1st Filter, 1dB Att1 residual, 2.8dB NF = 8.8dB # L2 : 1dB Att2 residual, 4.5dB BPF, 3dB NF = 8.5dB # G1 : = 20.0dB # # -> breakpoint ~ 20dB # #----------------------------------------------------------------------------- # New RTM AFE characteristics are different (assume 140 ft LMR: 2.2db/100ft): # L1 : 3.1 dB cable, 4.5 dB 1st BPF, 1.1 dB att1, 3.3dB NF = 12.0dB # L2 : 1.1 dB att2, 2.7 dB NF, 1 dB BPF = 4.8dB # G1 : = 16.0dB # # -> breakpoint ~ 23dB # #----------------------------------------------------------------------------- # # Semantics of the different fields # A: Total attenuation (ATT records deposits value there) # B: ATTO # C: CLAO # D: BPT Breakpoint (see above) # E: (ATT1MAX) max. ATT1 attenuation (depends on version, set by ATTINIT) # F: (ATT2MAX) max. ATT2 attenuation (depends on version, set by ATTINIT) # # if ( (T=ATT+ATTO) > ATT1MAX + ATT2MAX ) # T = ATT1MAX + ATT2MAX # endif # # if ( (A1 = floor((T - BPT)/2)) < 0 ) # A1 = 0; # A2 = T; # else # if (A1 > ATT1MAX) # A1 = ATT1MAX; # endif # A2 = T - A1 # endif # # if ( A2 > ATT2MAX ) # A1 = A2-ATT2MAX # A2 = ATT2MAX # endif # # CA = CLAO + ATT1MAX + ATT2MAX - ATT # if ( CA < 0 ) # CA = 0 # else if ( CA > ACMAX ) # CA = ACMAX # endif # # Then, it writes three links: # HL3A:SBPM:HL42:ATT1 = A1 # HL3A:SBPM:HL42:ATT2 = A2 # HL3A:SBPM:HL42:CALA = CA # record(sub, "HL3A:SBPM:HL42:ATTC") { # Note: this record uses it's name to calculate # db link addresses to ATT1, ATT2, CALA field(DESC, "AFE Total Att. Calc.") # initialize fields to max. attenuation: # During init: # 1. hw initializes to max # 2. this record holds max # 3. PINI of the placeholder PVs (ATT, ATTO & friends) # trickle in and cause the total attenuation to # go down... field(A, "30") field(B, "0") field(C, "60") field(D, "20") field(EGU, "dB") field(INAM, "subAttIni") field(SNAM, "subAtt") } #propagate 'ACCESS.RVAL' state to #attenuator control #This record is unused in stdalone mode 'b' record(bo, "HL3A:SBPM:HL42:ACTL") { field(DESC, "ATT OMSL Ctrl") field(DTYP, "Soft Channel") field(DOL, "HL3A:SBPM:HL42:ACCESS.RVAL CP") field(OMSL, "closed_loop") field(OUT, "HL3A:SBPM:HL42:ATT.OMSL PP") } ### ### Keep 'ATTO' and 'CLAO' on the main/VME IOC. ### It is more confusing but then we don't have ### to restore anything across reboots on the PAD ### IOC... ### ### This db now used for AFEs controlled by either ### a VME IOC or a PAD IOC. Use the same db for ### both for simplicity. ### ### NOTE: We could use the INPB / INPC ### links of ATTC directly but we DONT. ### Potentially, ATTC can be processed ### on every shot -- we don't want the ### links to be fetched every time for ### efficiency reasons. Hence the 'propagator' ### records which monitor ATTO/CLAO and ### write to ATTC.B ATTC.C only when ### necessary... record(longout, "HL3A:SBPM:HL42:ATTOL") { field(DESC, "ATTO Propagator") field(DTYP, "Soft Channel") field(DOL, "HL3A:SBPM:HL42:ATTO CP") field(OMSL, "closed_loop") field(OUT, "HL3A:SBPM:HL42:ATTC.B PP") field(EGU, "dB") } record(longout, "HL3A:SBPM:HL42:CLAOL") { field(DESC, "CLAO Propagator") field(DTYP, "Soft Channel") field(DOL, "HL3A:SBPM:HL42:CLAO CP") field(OMSL, "closed_loop") field(OUT, "HL3A:SBPM:HL42:ATTC.C PP") field(EGU, "dB") } record(calc, "HL3A:SBPM:HL42:AFE_COMM_CALC") { field(DESC, "AFE communication error") field(SCAN, "10 second") field(CALC, "(A>0 && A<255)?1:0") field(INPA, "HL3A:SBPM:HL42:VERS PP") field(FLNK, "HL3A:SBPM:HL42:AFE_COMM") } record(bi, "HL3A:SBPM:HL42:AFE_COMM") { field(DESC, "AFE communication error") field(INP, "HL3A:SBPM:HL42:AFE_COMM_CALC") field(ZNAM, "Fault") field(ZSV, "MAJOR") field(ONAM, "Ok") } # Records only needed for RTM AFE record(longout, "HL3A:SBPM:HL42:TRIG2BEAM") { field(DESC, "Trigger -> ADC trig") field(DTYP, "BusAddress") field(OUT, "#C0S0@AFE6+0x15,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVH, "255") field(PINI, "YES") info(autosaveFields, "VAL") } record(longout, "HL3A:SBPM:HL42:RF2RED") { field(DESC, "Red RF -> ADC trig") field(DTYP, "BusAddress") field(OUT, "#C0S0@AFE6+0x16,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVH, "255") field(VAL, "6") field(PINI, "YES") info(autosaveFields, "VAL") } record(longout, "HL3A:SBPM:HL42:RF2GRN") { field(DESC, "Grn RF -> ADC trig") field(DTYP, "BusAddress") field(OUT, "#C0S0@AFE6+0x17,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVH, "255") field(VAL, "6") field(PINI, "YES") info(autosaveFields, "VAL") } # bpmAfe.db; database for controlling stripline-BPM AFE # This database should not be loaded on PADs w/o AFE hardware. # # THIS FILE WAS GENERATED WITH msi FROM bpmPadAfe.template or bpmVmeDigiAfe.db AND EXPANDED FOR # # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # MODE: a -- Use VME IOC PVs # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # # NOTE: The template can be configured by means of proper macro # substitutions to # a) operate in 'normal' LCLS stripline BPM mode. In this # mode a few CA links to the VME/main IOC are active fetching # '$(dev):ACCESS', '$(dev):ATTO' and '$(dev):CLAO' from the # main IOC. # # b) standalone mode. In this mode, ACCESS is ignored and 'ATTO' and # 'CLAO' are instantiated / hosted on the PAD IOC. # # Mode 'a' is chosen by substituting # 'suffix' ='L', # 'propomsl' = 'closed_loop' # 'attomsl' = 'supervisory' # 'chrgL' = ' CPP' # 'actlL' = '$(dev):ACCESS.RVAL CP' # 'attoL' = '$(dev):ATTO CP' # 'claoL' = '$(dev):CLAO CP' # # Mode 'b' is chosen by substituting # 'suffix' = '' (empty) # 'propomsl' = 'supervisory' # 'attomsl' = 'supervisory' # 'chrgL' = '0' # 'actlL' = '0' # 'attoL' = '0' # 'claoL' = '0' # # SUBSTITUTIONS: # Substitutions available in main .db file # 'dev' : device name prefix # 'chrg' : name of global attenuator PV (for scaling all AFE attenuators with beam charge)(mode a) or '0' (mode b) # 'chrg' is only available in mode 'a'. # # Substitutions available in the template -- intended to be expanded when generating '.db' with MSI. # # 'chrgL' : name of global attenuator PV (for scaling all AFE attenuators with beam charge) + CPP attribute (mode a) or '0' (mode b) # 'actlL' : name of ACCESS.RVAL PV + CP attribute (mode a) or '0' (mode b) # 'attoL' : name of ATTO PV + CP attribute (mode a) or '0' (mode b) # 'claoL' : name of CLAO PV + CP attribute (mode a) or '0' (mode b) #'attomsl' : default/initial OMSL; if 'supervisory' then the 'ATT' PV controls attenuators # if 'closed_loop' then ATT is fetched from it's DOL (=='chrg' PV). # 'suffix' : see above. #'propomsl': see above. # # LINKS (pointing outside of this file): These links are only used in mode a and set to '0' in mode b. # HL3A:SBPM:HL43:ATT.DOL <---- VIOC:GUN:BPM:ATTR CPP // DEFINED IN: [depends on 'chrg' macro substitution]. # HL3A:SBPM:HL43:ACTL.DOL <---- HL3A:SBPM:HL43:ACCESS.RVAL CP // DEFINED IN: associated main IOC database 'IOC--BPbpm.db' # HL3A:SBPM:HL43:ATTOL.DOL<---- HL3A:SBPM:HL43:ATTO CP // DEFINED IN: associated main IOC database 'IOC--BPbpm.db' # HL3A:SBPM:HL43:CLAOL.DOL<---- HL3A:SBPM:HL43:CLAO CP // DEFINED IN: associated main IOC database 'IOC--BPbpm.db' # # # # Additional macros added to support other architectures. These macros do NOT need to be populated for PAD AFEs # because the default value is set for them: # # instance - AFE identifier (0,1,... or identifying string) # devsup - device support name (qspiAfe for 'generic' suppport used by SLAC RTM and XTA AFE) # type - AFE flavor, 0 for PAD, 1 for XTA, 2 for RTM # record(longout, "HL3A:SBPM:HL43:CALA") { field(DESC, "AFE Cal. Att.") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE7+1,qspiAfe") field(LOPR, "0") field(HOPR, "31") field(DRVL, "6") field(DRVH, "31") field(EGU, "dB") } record(longout, "HL3A:SBPM:HL43:ATT1") { field(DESC, "AFE Att. 1") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE7+2,qspiAfe") field(LOPR, "0") field(HOPR, "15") field(DRVL, "0") field(DRVH, "15") field(EGU, "dB") } record(longout, "HL3A:SBPM:HL43:ATT2") { field(DESC, "AFE Att. 2") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE7+3,qspiAfe") field(EGU, "dB") field(LOPR, "0") field(HOPR, "31") field(DRVL, "0") field(DRVH, "31") field(EGU, "dB") } # AFE FW versions (decimal): # 4 original LCLS-I FW version # >=32 ATT2 has 32 dB range; before 16 dB # 33 200 MHz board # 34 140 MHz board w/ 6dB PAD removed # 35 200 MHz board w/ 6dB PAD removed # > 64 140 MHz board not used with PAD/coldfire (XTA) # 8 MicroTCA RTM record(longin, "HL3A:SBPM:HL43:VERS") { field(DESC, "AFE Firmware Vers.") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(INP, "#C0S0@AFE7+5,qspiAfe") field(LOLO, "3") field(LLSV, "MAJOR") } record(longout, "HL3A:SBPM:HL43:AODL") { field(DESC, "Delay Trig -> AMP On") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE7+0x10,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVL, "255") } record(longout, "HL3A:SBPM:HL43:R1DL") { field(DESC, "Delay AMP On -> RF1") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE7+0x11,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVL, "255") } record(longout, "HL3A:SBPM:HL43:RFWD") { field(DESC, "RF Pulse Width") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE7+0x13,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVL, "255") info(autosaveFields, "VAL") } record(longout, "HL3A:SBPM:HL43:OFFT") { field(DESC, "Delay RF Off -> Ctrl Sw.") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE7+0x14,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVL, "255") } record(longout, "HL3A:SBPM:HL43:R2DL") { field(DESC, "Ctrl Sw. -> RF2") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE7+0x12,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVL, "255") } # This record just issues a CAL trigger record(longout, "HL3A:SBPM:HL43:CALT") { field(DESC, "AFE CAL Soft Trigger") field(DTYP, "BusAddress") # address is chip-select << 8 + register field(OUT, "#C0S0@AFE7+6,qspiAfe") } record(mbbo, "HL3A:SBPM:HL43:CALM") { field(DESC, "AFE Cal. Mode") field(DTYP, "BusAddress") field(OUT, "#C0S0@AFE7+0,softTogAfe") field(NOBT, "2") field(SHFT, "0") field(ZRST, "CAL RED") field(ZRVL, "0") field(ONST, "CAL GRN") field(ONVL, "1") field(THST, "CAL NONE") field(THVL, "3") # 'soft toggle' mode. NOTE: LSB must match RED or GRN # which choses the mode to start with field(FRST, "CAL TOGGLE") field(FRVL, "4") field(VAL, "4") field(PINI, "YES") } # Subroutine to set up attenuator limits at ioc startup. # Attenuator ranges vary among AFE types and FW versions # This record also in bpmVmeDigiAfePart.db record(aSub, "HL3A:SBPM:HL43:ATTINIT") { field(DESC, "Set up AFE att limits") field(PINI, "YES") field(SNAM, "subAttSetup") field(FTA, "LONG") field(INPA, "HL3A:SBPM:HL43:VERS PP") field(FTVA, "LONG") field(OUTA, "HL3A:SBPM:HL43:ATT1.HOPR") field(FTVB, "LONG") field(OUTB, "HL3A:SBPM:HL43:ATT1.DRVH") field(FTVC, "LONG") field(OUTC, "HL3A:SBPM:HL43:ATT2.HOPR") field(FTVD, "LONG") field(OUTD, "HL3A:SBPM:HL43:ATT2.DRVH") field(FTVE, "LONG") field(OUTE, "HL3A:SBPM:HL43:ATT.HOPR") field(FTVF, "LONG") field(OUTF, "HL3A:SBPM:HL43:ATT.DRVH") field(FTVG, "LONG") field(OUTG, "HL3A:SBPM:HL43:ATT.VAL") field(FTVH, "LONG") field(OUTH, "HL3A:SBPM:HL43:ATTC.D") field(FTVI, "LONG") field(OUTI, "HL3A:SBPM:HL43:ATTC.E") field(FTVJ, "LONG") field(OUTJ, "HL3A:SBPM:HL43:ATTC.F") field(FTVK, "LONG") field(OUTK, "HL3A:SBPM:HL43:ATTO.DRVL") field(FTVL, "LONG") field(OUTL, "HL3A:SBPM:HL43:ATTO.LOPR") field(FTVM, "LONG") field(OUTM, "HL3A:SBPM:HL43:ATTO.DRVH") field(FTVN, "LONG") field(OUTN, "HL3A:SBPM:HL43:ATTO.HOPR") field(FTVO, "LONG") field(OUTO, "HL3A:SBPM:HL43:CLAO.DRVL") field(FTVP, "LONG") field(OUTP, "HL3A:SBPM:HL43:CLAO.LOPR") field(FTVQ, "LONG") field(OUTQ, "HL3A:SBPM:HL43:CLAO.DRVH") field(FTVR, "LONG") field(OUTR, "HL3A:SBPM:HL43:CLAO.HOPR") field(FLNK, "HL3A:SBPM:HL43:ATT") } # Total attenuation (but ATTO is still added to this) record(longout, "HL3A:SBPM:HL43:ATT") { field(DESC, "AFE Total Attenuation") field(OUT, "HL3A:SBPM:HL43:ATTC.A PP") field(DRVL, "0") field(DRVH, "30") field(LOPR, "0") field(HOPR, "30") field(EGU, "dB") field(DOL, "VIOC:GUN:BPM:ATTR CPP") field(OMSL, "supervisory") field(VAL, "30") } # This subroutine record performs the # following operation (ATTC.D defines # the breakpoint where ATT1 kicks in # -- it depends on losses and gains: # BPT = G1 + L1 - L2 # with # G1: gain of 1st stage, # L1: loss + NF upstream of 1st stage, # L2: loss between 1st and 2nd stage + NF of 2nd stage # # if L1 : 2dB cable, 3dB 1st Filter, 1dB Att1 residual, 2.8dB NF = 8.8dB # L2 : 1dB Att2 residual, 4.5dB BPF, 3dB NF = 8.5dB # G1 : = 20.0dB # # -> breakpoint ~ 20dB # #----------------------------------------------------------------------------- # New RTM AFE characteristics are different (assume 140 ft LMR: 2.2db/100ft): # L1 : 3.1 dB cable, 4.5 dB 1st BPF, 1.1 dB att1, 3.3dB NF = 12.0dB # L2 : 1.1 dB att2, 2.7 dB NF, 1 dB BPF = 4.8dB # G1 : = 16.0dB # # -> breakpoint ~ 23dB # #----------------------------------------------------------------------------- # # Semantics of the different fields # A: Total attenuation (ATT records deposits value there) # B: ATTO # C: CLAO # D: BPT Breakpoint (see above) # E: (ATT1MAX) max. ATT1 attenuation (depends on version, set by ATTINIT) # F: (ATT2MAX) max. ATT2 attenuation (depends on version, set by ATTINIT) # # if ( (T=ATT+ATTO) > ATT1MAX + ATT2MAX ) # T = ATT1MAX + ATT2MAX # endif # # if ( (A1 = floor((T - BPT)/2)) < 0 ) # A1 = 0; # A2 = T; # else # if (A1 > ATT1MAX) # A1 = ATT1MAX; # endif # A2 = T - A1 # endif # # if ( A2 > ATT2MAX ) # A1 = A2-ATT2MAX # A2 = ATT2MAX # endif # # CA = CLAO + ATT1MAX + ATT2MAX - ATT # if ( CA < 0 ) # CA = 0 # else if ( CA > ACMAX ) # CA = ACMAX # endif # # Then, it writes three links: # HL3A:SBPM:HL43:ATT1 = A1 # HL3A:SBPM:HL43:ATT2 = A2 # HL3A:SBPM:HL43:CALA = CA # record(sub, "HL3A:SBPM:HL43:ATTC") { # Note: this record uses it's name to calculate # db link addresses to ATT1, ATT2, CALA field(DESC, "AFE Total Att. Calc.") # initialize fields to max. attenuation: # During init: # 1. hw initializes to max # 2. this record holds max # 3. PINI of the placeholder PVs (ATT, ATTO & friends) # trickle in and cause the total attenuation to # go down... field(A, "30") field(B, "0") field(C, "60") field(D, "20") field(EGU, "dB") field(INAM, "subAttIni") field(SNAM, "subAtt") } #propagate 'ACCESS.RVAL' state to #attenuator control #This record is unused in stdalone mode 'b' record(bo, "HL3A:SBPM:HL43:ACTL") { field(DESC, "ATT OMSL Ctrl") field(DTYP, "Soft Channel") field(DOL, "HL3A:SBPM:HL43:ACCESS.RVAL CP") field(OMSL, "closed_loop") field(OUT, "HL3A:SBPM:HL43:ATT.OMSL PP") } ### ### Keep 'ATTO' and 'CLAO' on the main/VME IOC. ### It is more confusing but then we don't have ### to restore anything across reboots on the PAD ### IOC... ### ### This db now used for AFEs controlled by either ### a VME IOC or a PAD IOC. Use the same db for ### both for simplicity. ### ### NOTE: We could use the INPB / INPC ### links of ATTC directly but we DONT. ### Potentially, ATTC can be processed ### on every shot -- we don't want the ### links to be fetched every time for ### efficiency reasons. Hence the 'propagator' ### records which monitor ATTO/CLAO and ### write to ATTC.B ATTC.C only when ### necessary... record(longout, "HL3A:SBPM:HL43:ATTOL") { field(DESC, "ATTO Propagator") field(DTYP, "Soft Channel") field(DOL, "HL3A:SBPM:HL43:ATTO CP") field(OMSL, "closed_loop") field(OUT, "HL3A:SBPM:HL43:ATTC.B PP") field(EGU, "dB") } record(longout, "HL3A:SBPM:HL43:CLAOL") { field(DESC, "CLAO Propagator") field(DTYP, "Soft Channel") field(DOL, "HL3A:SBPM:HL43:CLAO CP") field(OMSL, "closed_loop") field(OUT, "HL3A:SBPM:HL43:ATTC.C PP") field(EGU, "dB") } record(calc, "HL3A:SBPM:HL43:AFE_COMM_CALC") { field(DESC, "AFE communication error") field(SCAN, "10 second") field(CALC, "(A>0 && A<255)?1:0") field(INPA, "HL3A:SBPM:HL43:VERS PP") field(FLNK, "HL3A:SBPM:HL43:AFE_COMM") } record(bi, "HL3A:SBPM:HL43:AFE_COMM") { field(DESC, "AFE communication error") field(INP, "HL3A:SBPM:HL43:AFE_COMM_CALC") field(ZNAM, "Fault") field(ZSV, "MAJOR") field(ONAM, "Ok") } # Records only needed for RTM AFE record(longout, "HL3A:SBPM:HL43:TRIG2BEAM") { field(DESC, "Trigger -> ADC trig") field(DTYP, "BusAddress") field(OUT, "#C0S0@AFE7+0x15,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVH, "255") field(PINI, "YES") info(autosaveFields, "VAL") } record(longout, "HL3A:SBPM:HL43:RF2RED") { field(DESC, "Red RF -> ADC trig") field(DTYP, "BusAddress") field(OUT, "#C0S0@AFE7+0x16,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVH, "255") field(VAL, "6") field(PINI, "YES") info(autosaveFields, "VAL") } record(longout, "HL3A:SBPM:HL43:RF2GRN") { field(DESC, "Grn RF -> ADC trig") field(DTYP, "BusAddress") field(OUT, "#C0S0@AFE7+0x17,qspiAfe") field(EGU, "33ns") field(LOPR, "1") field(DRVL, "1") field(HOPR, "255") field(DRVH, "255") field(VAL, "6") field(PINI, "YES") info(autosaveFields, "VAL") } # Registers on Struck AMC # Digitizer AMC FW version record(stringin, "HL2:SBPM:HL36:DIGIVERS") { field(DESC, "Digitizer Firmware Vers.") field(DTYP, "sis8300Digi") # address is digitizer base address + register field(INP, "#C0S0@0x4F8(8)") field(PINI, "YES") } # Firmware date record(stringin, "HL2:SBPM:HL36:DIGIVERS_DATE") { field(DESC, "Firmware Vers. Date") field(DTYP, "sis8300Digi") # address is digitizer base address + register field(INP, "#C0S0@0x4FE(8)") field(PINI, "YES") } # System ID record(stringin, "HL2:SBPM:HL36:DIGI_SYSID") { field(DESC, "Digitizer System ID") field(DTYP, "sis8300Digi") # address is digitizer base address + register field(INP, "#C0S0@0x4FA(8)") field(PINI, "YES") } # Sub Type record(stringin, "HL2:SBPM:HL36:SUBSYS") { field(DESC, "Subsystem type") field(DTYP, "sis8300Digi") # address is digitizer base address + register field(INP, "#C0S0@0x4FC(8)") field(PINI, "YES") } # Registers on Struck AMC # Digitizer AMC FW version record(stringin, "HL2:SBPM:HL37:DIGIVERS") { field(DESC, "Digitizer Firmware Vers.") field(DTYP, "sis8300Digi") # address is digitizer base address + register field(INP, "#C1S0@0x4F8(8)") field(PINI, "YES") } # Firmware date record(stringin, "HL2:SBPM:HL37:DIGIVERS_DATE") { field(DESC, "Firmware Vers. Date") field(DTYP, "sis8300Digi") # address is digitizer base address + register field(INP, "#C1S0@0x4FE(8)") field(PINI, "YES") } # System ID record(stringin, "HL2:SBPM:HL37:DIGI_SYSID") { field(DESC, "Digitizer System ID") field(DTYP, "sis8300Digi") # address is digitizer base address + register field(INP, "#C1S0@0x4FA(8)") field(PINI, "YES") } # Sub Type record(stringin, "HL2:SBPM:HL37:SUBSYS") { field(DESC, "Subsystem type") field(DTYP, "sis8300Digi") # address is digitizer base address + register field(INP, "#C1S0@0x4FC(8)") field(PINI, "YES") } # Registers on Struck AMC # Digitizer AMC FW version record(stringin, "HL2:SBPM:HL38:DIGIVERS") { field(DESC, "Digitizer Firmware Vers.") field(DTYP, "sis8300Digi") # address is digitizer base address + register field(INP, "#C2S0@0x4F8(8)") field(PINI, "YES") } # Firmware date record(stringin, "HL2:SBPM:HL38:DIGIVERS_DATE") { field(DESC, "Firmware Vers. Date") field(DTYP, "sis8300Digi") # address is digitizer base address + register field(INP, "#C2S0@0x4FE(8)") field(PINI, "YES") } # System ID record(stringin, "HL2:SBPM:HL38:DIGI_SYSID") { field(DESC, "Digitizer System ID") field(DTYP, "sis8300Digi") # address is digitizer base address + register field(INP, "#C2S0@0x4FA(8)") field(PINI, "YES") } # Sub Type record(stringin, "HL2:SBPM:HL38:SUBSYS") { field(DESC, "Subsystem type") field(DTYP, "sis8300Digi") # address is digitizer base address + register field(INP, "#C2S0@0x4FC(8)") field(PINI, "YES") } # Registers on Struck AMC # Digitizer AMC FW version record(stringin, "HL3A:SBPM:HL39:DIGIVERS") { field(DESC, "Digitizer Firmware Vers.") field(DTYP, "sis8300Digi") # address is digitizer base address + register field(INP, "#C3S0@0x4F8(8)") field(PINI, "YES") } # Firmware date record(stringin, "HL3A:SBPM:HL39:DIGIVERS_DATE") { field(DESC, "Firmware Vers. Date") field(DTYP, "sis8300Digi") # address is digitizer base address + register field(INP, "#C3S0@0x4FE(8)") field(PINI, "YES") } # System ID record(stringin, "HL3A:SBPM:HL39:DIGI_SYSID") { field(DESC, "Digitizer System ID") field(DTYP, "sis8300Digi") # address is digitizer base address + register field(INP, "#C3S0@0x4FA(8)") field(PINI, "YES") } # Sub Type record(stringin, "HL3A:SBPM:HL39:SUBSYS") { field(DESC, "Subsystem type") field(DTYP, "sis8300Digi") # address is digitizer base address + register field(INP, "#C3S0@0x4FC(8)") field(PINI, "YES") } # Registers on Struck AMC # Digitizer AMC FW version record(stringin, "HL3A:SBPM:HL40:DIGIVERS") { field(DESC, "Digitizer Firmware Vers.") field(DTYP, "sis8300Digi") # address is digitizer base address + register field(INP, "#C4S0@0x4F8(8)") field(PINI, "YES") } # Firmware date record(stringin, "HL3A:SBPM:HL40:DIGIVERS_DATE") { field(DESC, "Firmware Vers. Date") field(DTYP, "sis8300Digi") # address is digitizer base address + register field(INP, "#C4S0@0x4FE(8)") field(PINI, "YES") } # System ID record(stringin, "HL3A:SBPM:HL40:DIGI_SYSID") { field(DESC, "Digitizer System ID") field(DTYP, "sis8300Digi") # address is digitizer base address + register field(INP, "#C4S0@0x4FA(8)") field(PINI, "YES") } # Sub Type record(stringin, "HL3A:SBPM:HL40:SUBSYS") { field(DESC, "Subsystem type") field(DTYP, "sis8300Digi") # address is digitizer base address + register field(INP, "#C4S0@0x4FC(8)") field(PINI, "YES") } # Registers on Struck AMC # Digitizer AMC FW version record(stringin, "HL3A:SBPM:HL41:DIGIVERS") { field(DESC, "Digitizer Firmware Vers.") field(DTYP, "sis8300Digi") # address is digitizer base address + register field(INP, "#C5S0@0x4F8(8)") field(PINI, "YES") } # Firmware date record(stringin, "HL3A:SBPM:HL41:DIGIVERS_DATE") { field(DESC, "Firmware Vers. Date") field(DTYP, "sis8300Digi") # address is digitizer base address + register field(INP, "#C5S0@0x4FE(8)") field(PINI, "YES") } # System ID record(stringin, "HL3A:SBPM:HL41:DIGI_SYSID") { field(DESC, "Digitizer System ID") field(DTYP, "sis8300Digi") # address is digitizer base address + register field(INP, "#C5S0@0x4FA(8)") field(PINI, "YES") } # Sub Type record(stringin, "HL3A:SBPM:HL41:SUBSYS") { field(DESC, "Subsystem type") field(DTYP, "sis8300Digi") # address is digitizer base address + register field(INP, "#C5S0@0x4FC(8)") field(PINI, "YES") } # Registers on Struck AMC # Digitizer AMC FW version record(stringin, "HL3A:SBPM:HL42:DIGIVERS") { field(DESC, "Digitizer Firmware Vers.") field(DTYP, "sis8300Digi") # address is digitizer base address + register field(INP, "#C6S0@0x4F8(8)") field(PINI, "YES") } # Firmware date record(stringin, "HL3A:SBPM:HL42:DIGIVERS_DATE") { field(DESC, "Firmware Vers. Date") field(DTYP, "sis8300Digi") # address is digitizer base address + register field(INP, "#C6S0@0x4FE(8)") field(PINI, "YES") } # System ID record(stringin, "HL3A:SBPM:HL42:DIGI_SYSID") { field(DESC, "Digitizer System ID") field(DTYP, "sis8300Digi") # address is digitizer base address + register field(INP, "#C6S0@0x4FA(8)") field(PINI, "YES") } # Sub Type record(stringin, "HL3A:SBPM:HL42:SUBSYS") { field(DESC, "Subsystem type") field(DTYP, "sis8300Digi") # address is digitizer base address + register field(INP, "#C6S0@0x4FC(8)") field(PINI, "YES") } # Registers on Struck AMC # Digitizer AMC FW version record(stringin, "HL3A:SBPM:HL43:DIGIVERS") { field(DESC, "Digitizer Firmware Vers.") field(DTYP, "sis8300Digi") # address is digitizer base address + register field(INP, "#C7S0@0x4F8(8)") field(PINI, "YES") } # Firmware date record(stringin, "HL3A:SBPM:HL43:DIGIVERS_DATE") { field(DESC, "Firmware Vers. Date") field(DTYP, "sis8300Digi") # address is digitizer base address + register field(INP, "#C7S0@0x4FE(8)") field(PINI, "YES") } # System ID record(stringin, "HL3A:SBPM:HL43:DIGI_SYSID") { field(DESC, "Digitizer System ID") field(DTYP, "sis8300Digi") # address is digitizer base address + register field(INP, "#C7S0@0x4FA(8)") field(PINI, "YES") } # Sub Type record(stringin, "HL3A:SBPM:HL43:SUBSYS") { field(DESC, "Subsystem type") field(DTYP, "sis8300Digi") # address is digitizer base address + register field(INP, "#C7S0@0x4FC(8)") field(PINI, "YES") }