# # Dedicated PV's for femtosecond controls # Replaces matlab PVs: SIOC:SYS0:ML01:AO480 to AO493 # # SIOC:SYS0:ML01:AO480 # Watchdog counter, increments when the code is running, set to # zero to kill the code. Locks against multiple copies record( longout, "$(DEV):FS_WATCHDOG" ) { field( DESC, "Watchdog counter" ) field( VAL, "0" ) field( EGU, "counts" ) field( PINI, "YES" ) info(autosaveFields, "VAL DESC EGU HHSV HIGH HIHI HSV LLSV LOLO LOW LSV") } # SIOC:SYS0:ML01:AO481 # This is the correct frequency counter frequency # used to guard against accidental incorrect entries. record( ao, "$(DEV):FS_OSC_TGT_FREQ" ) { field( DESC, "Osc. Target Freq" ) field( VAL, "0.0" ) field( PREC, "6" ) field( EGU, "Hz" ) field( PINI, "YES" ) info(autosaveFields, "VAL DESC EGU HHSV HIGH HIHI HSV LLSV LOLO LOW LSV PREC") } # SIOC:SYS0:ML01:AO482 # The time (in nanoseconds) for the laser pulse. Setting this # will change phase shifts (and if enabled, triggers) to produce a laser # output pulse at this time as measured on the frequency counter record( ao, "$(DEV):FS_TGT_TIME" ) { field( DESC, "Target Time (Phase Offset)" ) field( VAL, "0.0" ) field( PREC, "6" ) field( EGU, "ns" ) field( PINI, "YES" ) info(autosaveFields, "VAL DESC EGU HHSV HIGH HIHI HSV LLSV LOLO LOW LSV PREC") } # Dial Coordinates support for FS_TGT_TIME # Consists of two PVs, FS_TGT_TIME_DIAL and FS_TGT_TIME_OFFSET # DIAL + OFFSET = FS_TGT_TIME # FWDPROP calc record monitors FS_TGT_TIME and OFFSET and recalculates DIAL # REVPROP calc record montiors DIAL and recalculates FS_TGT_TIME record( ao, "$(DEV):FS_TGT_TIME_DIAL" ) { field( DESC, "Target Time (Dial Coord)" ) field( PREC, "6" ) field( EGU, "ns" ) field( PINI, "YES" ) info(autosaveFields, "DESC EGU HHSV HIGH HIHI HSV LLSV LOLO LOW LSV PREC") } record( ao, "$(DEV):FS_TGT_TIME_OFFSET" ) { field( DESC, "Target Time Dial Offset" ) field( VAL, "0" ) field( PREC, "6" ) field( EGU, "ns" ) field( PINI, "YES" ) info(autosaveFields, "VAL DESC EGU HHSV HIGH HIHI HSV LLSV LOLO LOW LSV PREC") } record( calcout, "$(DEV):FS_TGT_TIME_FWDPROP" ) { field( DESC, "Target Time FWD Propagation" ) field( INPA, "$(DEV):FS_TGT_TIME CP MS" ) field( INPB, "$(DEV):FS_TGT_TIME_OFFSET CP MS" ) field( CALC, "A-B" ) field( OUT, "$(DEV):FS_TGT_TIME_DIAL PP MS" ) field( OOPT, "On Change" ) field( EGU, "ns" ) field( PREC, "6" ) info(autosaveFields, "DESC EGU HHSV HIGH HIHI HSV LLSV LOLO LOW LSV PREC") } record( calcout, "$(DEV):FS_TGT_TIME_REVPROP" ) { field( DESC, "Target Time REV Propagation" ) field( INPA, "$(DEV):FS_TGT_TIME_DIAL CP MS" ) field( INPB, "$(DEV):FS_TGT_TIME_OFFSET NPP MS" ) field( CALC, "A+B" ) field( OUT, "$(DEV):FS_TGT_TIME PP MS" ) field( OOPT, "On Change" ) field( EGU, "ns" ) field( PREC, "6" ) info(autosaveFields, "DESC EGU HHSV HIGH HIHI HSV LLSV LOLO LOW LSV PREC") } # SIOC:SYS0:ML01:AO483 # Use for calibration. This should NOT be on a top level panel. # Toggle to 1 to run a calibration cycle # Set back to zero automatically when done record( bo, "$(DEV):FS_START_CALIB" ) { field( DESC, "Start Calib." ) field( VAL, "0" ) field( ZNAM, "Ready" ) field( ONAM, "Calibrating" ) field( ZSV, "NO_ALARM" ) field( OSV, "MINOR" ) field( PINI, "YES" ) info(autosaveFields, "VAL DESC OSV ZSV COSV") } # SIOC:SYS0:ML01:AO484 # Enable time control # When this is 0, the high level app does not attempt to control the laser time and it can be operated manually (interaction with calibration and bucket jump detection has not been checked). record( bo, "$(DEV):FS_ENABLE_TIME_CTRL" ) { field( DESC, "Enable time control" ) field( VAL, "0" ) field( ZNAM, "Disabled" ) field( ONAM, "Enabled" ) field( ZSV, "MINOR" ) field( OSV, "NO_ALARM" ) field( PINI, "YES" ) info(autosaveFields, "VAL DESC OSV ZSV COSV") } # SIOC:SYS0:ML01:AO485 # Set to 1 to indicate when the software is busy - not fully # implemented yet record( bo, "$(DEV):FS_CTRL_BUSY" ) { field( DESC, "FS Control Busy" ) field( VAL, "0" ) field( ZNAM, "Idle" ) field( ONAM, "Busy" ) field( PINI, "YES" ) info(autosaveFields, "VAL DESC OSV ZSV COSV") } # Time Interval Counter measurement error range # Monitor for bucket jumps record( ao, "$(DEV):FS_TIC_ERROR" ) { field( DESC, "TIC Meas. Range." ) field( VAL, "0.0" ) field( PREC, "6" ) field( EGU, "ticks" ) field( PINI, "YES" ) info(autosaveFields, "VAL DESC EGU HHSV HIGH HIHI HSV LLSV LOLO LOW LSV PREC") } # SIOC:SYS0:ML01:AO486 # Timing error # Difference between measured laser time (on interval counter) and desired time. # Indicates any errors on the timing control. # Note that the time interval counter only has ~10ps resolution # so this is used to detect large jumps. # The actual laser stability is # much better than 1ps, but can't be measured this way record( ao, "$(DEV):FS_TIMING_ERROR" ) { field( DESC, "Timing Error" ) field( VAL, "0.0" ) field( PREC, "6" ) field( EGU, "ns" ) field( PINI, "YES" ) info(autosaveFields, "VAL DESC EGU HHSV HIGH HIHI HSV LLSV LOLO LOW LSV PREC") } # SIOC:SYS0:ML01:AO487 # Laser OK # signal levels are OK for the loop to operate record( bo, "$(DEV):FS_LASER_OK" ) { field( DESC, "Laser signal level OK" ) field( VAL, "0" ) field( ZNAM, "Low" ) field( ONAM, "OK" ) field( ZSV, "MINOR" ) field( OSV, "NO_ALARM" ) field( PINI, "YES" ) info(autosaveFields, "VAL DESC OSV ZSV COSV") } # SIOC:SYS0:ML01:AO487.DESC # string PV to indicate the latest error # Note: Could change to a waveform of characters for longer strings record( stringout, "$(DEV):FS_STATUS" ) { field( DESC, "FS Control Status" ) field( VAL, "" ) field( PINI, "YES" ) info(autosaveFields, "VAL DESC") } # SIOC:SYS0:ML01:AO488 # set to 1 (toggle) to enable automatic bucket correction. record( bo, "$(DEV):FS_ENABLE_BUCKET_FIX" ) { field( DESC, "Auto bucket corr." ) field( VAL, "0" ) field( ZNAM, "Disabled" ) field( ONAM, "Enabled" ) field( ZSV, "MINOR" ) field( OSV, "NO_ALARM" ) field( PINI, "YES" ) info(autosaveFields, "VAL DESC OSV ZSV COSV") } # SIOC:SYS0:ML01:AO489 # trigger delay # (not on top panel).. # Internal program information on timing delays record( ao, "$(DEV):FS_TRIGGER_DELAY" ) { field( DESC, "Trigger Delay" ) field( VAL, "0.0" ) field( PREC, "6" ) field( EGU, "ns" ) field( PINI, "YES" ) info(autosaveFields, "VAL DESC EGU HHSV HIGH HIHI HSV LLSV LOLO LOW LSV PREC") } # SIOC:SYS0:ML01:AO490 # timing offset # (not on top panel) # Internal program information on timing delays record( ao, "$(DEV):FS_TIMING_OFFSET" ) { field( DESC, "Timing Offset" ) field( VAL, "0.0" ) field( PREC, "6" ) field( EGU, "ns" ) field( PINI, "YES" ) info(autosaveFields, "VAL DESC EGU HHSV HIGH HIHI HSV LLSV LOLO LOW LSV PREC") } # SIOC:SYS0:ML01:AO491 # Enable trigger control # If enabled the software will # move the trigger as well as the phase control to allow long timing moves record( bo, "$(DEV):FS_ENABLE_TRIGGER" ) { field( DESC, "Trigger Ctrl Enabled" ) field( VAL, "0" ) field( ZNAM, "Disabled" ) field( ONAM, "Enabled" ) field( ZSV, "MINOR" ) field( OSV, "NO_ALARM" ) field( PINI, "YES" ) info(autosaveFields, "VAL DESC OSV ZSV COSV") } # SIOC:SYS0:ML01:AO492 # Buckets error # In the event of a timing jump this indicates # how many buckets of 3808MHz (8 X 476) have been jumped record( longout, "$(DEV):FS_BUCKET_ERROR" ) { field( DESC, "Buckets of 3808MHz Error" ) field( VAL, "0" ) field( EGU, "buckets" ) field( PINI, "YES" ) info(autosaveFields, "VAL DESC EGU HHSV HIGH HIHI HSV LLSV LOLO LOW LSV") } # SIOC:SYS0:ML01:AO493 # Error from integer buckets # If near zero, < 50ps, this indicates that the timing problem # is a bucket jump. # If larger, this indicates some other type of failure that # cannot be corrected with bucket changes. record( ao, "$(DEV):FS_UNFIXED_ERROR" ) { field( DESC, "Err from integer buckets" ) field( VAL, "0.0" ) field( PREC, "6" ) field( EGU, "ps" ) field( HIGH, "50" ) field( HIHI, "200" ) field( HSV, "MINOR" ) field( HHSV, "MAJOR" ) field( PINI, "YES" ) info(autosaveFields, "VAL DESC EGU HHSV HIGH HIHI HSV LLSV LOLO LOW LSV PREC") } #SIOC:SYS0:ML01:AO494 # Bucket corrects since reset record( longout, "$(DEV):FS_CORRECTION_CNT" ) { field( DESC, "Bucket corrects since reset" ) field( VAL, "0" ) field( EGU, "corrects" ) field( PINI, "YES" ) info(autosaveFields, "VAL DESC EGU HHSV HIGH HIHI HSV LLSV LOLO LOW LSV") } #SIOC:SYS0:ML01:AO495 # Phase Degrees S band control record( ao, "$(DEV):PDES" ) { field( DESC, "Degrees S band control" ) field( VAL, "0.0" ) field( PREC, "6" ) field( EGU, "deg 2856 MHz" ) field( PINI, "YES" ) info(autosaveFields, "VAL DESC EGU HHSV HIGH HIHI HSV LLSV LOLO LOW LSV PREC") } #SIOC:SYS0:ML01:AO496 # Phase Offset Control (degrees) record( ao, "$(DEV):POC" ) { field( DESC, "Phase Offset Control (degrees)" ) field( VAL, "0.0" ) field( PREC, "6" ) field( EGU, "deg 2856 MHz" ) field( PINI, "YES" ) info(autosaveFields, "VAL DESC EGU HHSV HIGH HIHI HSV LLSV LOLO LOW LSV PREC") } #SIOC:SYS0:ML01:AO497 # ns offset record( ao, "$(DEV):FS_NS_OFFSET" ) { field( DESC, "Phase offset (ns)" ) field( VAL, "0.0" ) field( PREC, "6" ) field( EGU, "ns" ) field( PINI, "YES" ) info(autosaveFields, "VAL DESC EGU HHSV HIGH HIHI HSV LLSV LOLO LOW LSV PREC") } #SIOC:SYS0:ML01:AO499 # last calibration error ns record( ao, "$(DEV):FS_CALIB_ERROR" ) { field( DESC, "last calibration error ns" ) field( VAL, "0.0" ) field( PREC, "6" ) field( EGU, "ns" ) field( PINI, "YES" ) info(autosaveFields, "VAL DESC EGU HHSV HIGH HIHI HSV LLSV LOLO LOW LSV PREC") } record( waveform, "$(DEV):FS_CALIB_DATA" ) { field( DESC, "last calibration error ns" ) field( PREC, "6" ) field( NELM, "10000" ) field( FTVL, "DOUBLE" ) field( PINI, "YES" ) info( autosaveFields, "VAL DESC EGU PREC" ) } # BANNER_COLOR # Integer that is evaluated in EDM to color code the screens for a given # facility. In PCDS, this means (color names by Sherwin-Williams): # 0 = N/A (Lazy Gray) # 1 = AMO (Blueblood) # 2 = SXR (Dorian Gray) # 3 = XPP (Straightforward Green) # 4 = XCS (Gutsy Grape) # 5 = CXI (Lusty Red) # 6 = MEC (Social Butterfly) # 7+ = Alarm (Flashing Red) record( longout, "$(DEV):BANNER_COLOR" ) { field( DESC, "EDM banner color" ) field( EGU, "Units of color" ) field( VAL, "1" ) } # EVR_TRIG_RATE # Calculates the effective trigger rate coming from one or two EVR triggers # used to fire the laser. The trigger rate PVs are passed in via vitara # configuration substitution. record( calc, "$(DEV):EVR_TRIG_RATE" ) { field( DESC, "EVR trigger rate" ) field( EGU, "Hz" ) field( INPA, "$(EVR):EVENT2RATE CP NMS" ) field( INPB, "$(TRIG):TCTL CP NMS") field( INPC, "0" ) field( INPD, "0") field( CALC, "A*B+C*D" ) field( PREC, "1" ) field( HIHI, "120.1" ) field( HHSV, "MAJOR" ) field( HIGH, "120.1" ) field( HSV, "MINOR" ) field( LOW, "119.9" ) field( LSV, "MINOR" ) field( LOLO, "119.9" ) field (LLSV, "MAJOR" ) } # The time in nanoseconds read by the SR620 frequency counter. # The raw value is subtracted from a 40,000 ns reference interval # so it can provides a comparable measurement to FS_TGT_TIME # Resolution is 50ps for the raw counter # 2014-02-19 klg: offset removed in favor of using offset record from SR620 record( calc, "$(DEV):FS_CTR_TIME" ) { field( DESC, "Counter Time" ) field( INPA, "$(DEV):GetOffsetInvMeasMean CPP MS" ) field( CALC, "A*1e9") field( PREC, "1" ) field( EGU, "ns" ) info(autosaveFields, "VAL DESC EGU HHSV HIGH HIHI HSV LLSV LOLO LOW LSV PREC") } # # vitaraRFChan.template # # Required Macros: # CH PV prefix for this RF channel # CH_DIODE Analog Input for RF Channel Diode Power # CH_GAIN Analog Output for RF Channel Gain # CH_PHASE Analog Input for RF Channel Phase # CH_PHASE_X30 Analog Input for RF Channel Phase times 30 # CH_RF_PWR Analog Input for RF Channel RF Power record( ai, "$(DEV):CH1_DIODE_PWR" ) { field( DESC, "Diode Power" ) field( INP, "$(DEV):PD_CH1_DIODE_PWR_RBCK CP MS" ) field( EGU, "V" ) field( PREC, "3" ) field( LOW, "1.75" ) field( LSV, "MINOR" ) field( LOLO, "1.5" ) field( LLSV, "MAJOR" ) info(autosaveFields, "DESC EGU HHSV HIGH HIHI HSV LLSV LOLO LOW LSV PREC") } record( ai, "$(DEV):CH1_RF_PWR" ) { field( DESC, "RF Power" ) field( INP, "$(DEV):PD_CH1_RF_PWR_RBCK CP MS" ) field( EGU, "V" ) field( PREC, "3" ) field( LOW, "1.25" ) field( LSV, "MINOR" ) field( LOLO, "1.0" ) field( LLSV, "MAJOR" ) info(autosaveFields, "DESC EGU HHSV HIGH HIHI HSV LLSV LOLO LOW LSV PREC") } record( ai, "$(DEV):CH1_PHASE" ) { field( DESC, "RF Phase" ) field( INP, "$(DEV):PD_CH1_PH_RBCK CP MS" ) field( EGU, "V" ) field( PREC, "3" ) info(autosaveFields, "DESC EGU HHSV HIGH HIHI HSV LLSV LOLO LOW LSV PREC") } record( ai, "$(DEV):CH1_PHASE_X30" ) { field( DESC, "RF Phase X30" ) field( INP, "$(DEV):PD_CH1_PH_X30_RBCK CP MS" ) field( EGU, "V" ) field( PREC, "3" ) info(autosaveFields, "DESC EGU HHSV HIGH HIHI HSV LLSV LOLO LOW LSV PREC") } record( bo, "$(DEV):CH1_LockBoardType" ) { field( DESC, "Locker type" ) field( VAL, "0" ) field( ZNAM, "Analog" ) field( ONAM, "Digital" ) field( PINI, "YES" ) info(autosaveFields, "VAL") } record( calc, "$(DEV):CH1_CALC_PHASE" ) { field( DESC, "Scaled phase calculation" ) field( INPA, "$(DEV):CH1_PHASE_X30 CP" ) field( INPB, "$(DEV):CH1_RF_PWR NPP" ) field( INPC, "$(DEV):CH1_DIODE_PWR NPP" ) field( INPD, "$(DEV):CH1_LockBoardType NPP" ) field( CALC, "D?(A*1000):((B*C)?(1000*A/SQR(B*C/2)):0)" ) field( EGU, "ps" ) field( PREC, "3" ) info(autosaveFields, "DESC EGU HHSV HIGH HIHI HSV LLSV LOLO LOW LSV PREC") } # In LCLS, this is an IP231 output in the Laser app on ioc-lr20-ls01. # So if SYS is defined as SYS0, change the PV name by tacking "_WRAPPER" # on to the end. record( ao, "$(DEV):CH1_FEEDBACK_GAIN" ) { field( DESC, "RF Feedback Gain" ) $(LNK) field( OUT, " CA MS" ) field( EGU, "V" ) field( VAL, "10.0" ) field( PREC, "3" ) field( PINI, "YES" ) info(autosaveFields, "DESC EGU HHSV HIGH HIHI HSV LLSV LOLO LOW LSV PREC VAL") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBDEND # # vitaraFreqSearch.template # # Required macros: #DEV - PV prefix for all vitara PV's #FREQ_MOTOR- Motor PV name #FREQ- Freq counter PV name # These first records provide a local PV with a common # prefix to make it easier to share screens and db templates record(ao, "$(DEV):FREQ_CUR") { field(DESC, "Current Vitara Freq") field(DOL, "$(DEV):FREQ_RBCK CP MS") field(OMSL, "closed_loop") field(EGU, "Hz") field(PREC, "0") field(FLNK, "$(DEV):FREQ_ERR") info(autosaveFields, "DESC EGU HHSV HIGH HIHI HSV LLSV LOLO LOW LSV PREC") } record(ai, "$(DEV):FREQ_MOTOR_POS") { field(DESC, "Cur Freq motor pos") field(INP, "$(DEV):M1_MOTR_C.RBV CP MS") field(EGU, "mm") field(PREC, "6") info(autosaveFields, "DESC EGU HHSV HIGH HIHI HSV LLSV LOLO LOW LSV PREC INP") } # Frequence target set point record(ao, "$(DEV):FREQ_SP") { field(DESC, "Freq target set point") field(VAL, "67999964") field(EGU, "Hz") field(PREC, "0") field(PINI, "YES") info(autosaveFields, "VAL HHSV HIGH HIHI HSV LLSV LOLO LOW LSV PREC") } record(calc, "$(DEV):FREQ_ERR") { field(DESC, "Freq Err in Hz") field(CALC, "A-B") field(INPA, "$(DEV):FREQ_CUR NPP NMS") field(INPB, "$(DEV):FREQ_SP CP") field(EGU, "Hz") field(PREC, "3") field(FLNK, "$(DEV):FREQ_ERR_SMOOTHED PP MS") info(autosaveFields, "DESC EGU HHSV HIGH HIHI HSV LLSV LOLO LOW LSV PREC") } # # Keep FREQ_ERR Limits consistent w/ search and lock criteria # # Propagate FREQ_ERR.HIHI # to FREQ_ERR_RMS.HIHI, FREQ_ERR.LOLO, and FREQ_ERR_RMS.LOLO record( dfanout, "$(DEV):FREQ_ERR_UPDATE_HIHI" ) { field( OMSL, "closed_loop" ) field( DOL, "$(DEV):FREQ_ERR.HIHI CPP NMS" ) field( OUTA, "$(DEV):FREQ_ERR_RMS.HIHI NPP NMS" ) field( FLNK, "$(DEV):FREQ_ERR_CALC_LOLO" ) } record( calc, "$(DEV):FREQ_ERR_CALC_LOLO" ) { field( INPA, "$(DEV):FREQ_ERR.HIHI NPP NMS" ) field( CALC, "-A" ) field( FLNK, "$(DEV):FREQ_ERR_UPDATE_LOLO" ) info(autosaveFields, "DESC EGU HHSV HIGH HIHI HSV LLSV LOLO LOW LSV PREC") } record( dfanout, "$(DEV):FREQ_ERR_UPDATE_LOLO" ) { field( OMSL, "closed_loop" ) field( DOL, "$(DEV):FREQ_ERR_CALC_LOLO" ) field( OUTA, "$(DEV):FREQ_ERR.LOLO NPP NMS" ) field( OUTB, "$(DEV):FREQ_ERR_RMS.LOLO NPP NMS" ) } # Propagate FREQ_TOLERANCE # to FREQ_ERR.HIGH, FREQ_ERR_RMS.HIGH, FREQ_ERR.LOW, and FREQ_ERR_RMS.LOW record( dfanout, "$(DEV):FREQ_ERR_UPDATE_HIGH" ) { field( OMSL, "closed_loop" ) field( DOL, "$(DEV):FREQ_TOLERANCE CPP NMS" ) field( OUTA, "$(DEV):FREQ_ERR.HIGH NPP NMS" ) field( OUTB, "$(DEV):FREQ_ERR_RMS.HIGH NPP NMS" ) } record( calc, "$(DEV):FREQ_ERR_CALC_LOW" ) { field( INPA, "$(DEV):FREQ_TOLERANCE CPP NMS" ) field( CALC, "-A" ) field( FLNK, "$(DEV):FREQ_ERR_UPDATE_LOW" ) info(autosaveFields, "DESC EGU HHSV HIGH HIHI HSV LLSV LOLO LOW LSV PREC") } record( dfanout, "$(DEV):FREQ_ERR_UPDATE_LOW" ) { field( OMSL, "closed_loop" ) field( DOL, "$(DEV):FREQ_ERR_CALC_LOW" ) field( OUTA, "$(DEV):FREQ_ERR.LOW NPP NMS" ) field( OUTB, "$(DEV):FREQ_ERR_RMS.LOW NPP NMS" ) field( FLNK, "$(DEV):FREQ_ERR_UPDATE_HIGH" ) } # SMOO field updated by $(DEV):FREQ_ERR_SMOOTH record(ai, "$(DEV):FREQ_ERR_SMOOTHED") { field(DESC, "Freq Err in Hz") field(SMOO, "0.5") field(INP, "$(DEV):FREQ_ERR") field(EGU, "Hz") field(PREC, "3") field(FLNK, "$(DEV):FREQ_MOTOR_TGT PP NMS") info(autosaveFields, "DESC EGU HHSV HIGH HIHI HSV LLSV LOLO LOW LSV PREC") } record(ao, "$(DEV):FREQ_ERR_SMOOTH") { field(DESC, "IIR filter smooth factor") field(VAL, "0.5") field(OUT, "$(DEV):FREQ_ERR_SMOOTHED.SMOO") field(PINI, "YES") field(PREC, "4") info(autosaveFields, "VAL HHSV HIGH HIHI HSV LLSV LOLO LOW LSV PREC") } # Calibrate for each system,do not merge or copy VAL. record(ao, "$(DEV):FREQ_ERR_CORRECTION") { field(DESC, "Freq err corr factor") field(VAL, "149800") field(EGU, "Hz/mm") field(PINI, "YES") field(PREC, "0") info(autosaveFields, "VAL HHSV HIGH HIHI HSV LLSV LOLO LOW LSV PREC") } record(calcout, "$(DEV):FREQ_MOTOR_TGT") { field(DESC, "Calc chamber motor target") field(CALC, "C - A/B") field(INPA, "$(DEV):FREQ_ERR_SMOOTHED NPP NMS") field(INPB, "$(DEV):FREQ_ERR_CORRECTION NPP NMS") field(INPC, "$(DEV):FREQ_MOTOR_POS CA MS") field(EGU, "mm") field(PREC, "5") info(autosaveFields, "HHSV HIGH HIHI HSV LLSV LOLO LOW LSV PREC") } # Only process this PV when you want to move the motor # to $(DEV):FREQ_MOTOR_TGT record(ao, "$(DEV):FREQ_MOTOR_POS_GOTO") { field(DESC, "Go to calc motor pos") field(OMSL, "closed_loop") field(DOL, "$(DEV):FREQ_MOTOR_TGT NPP MS") field(OUT, "$(DEV):M1_MOTR_C.VAL PP") field(EGU, "mm") field(FLNK, "$(DEV):FREQ_RETRY_COUNTER PP NMS") info(autosaveFields, "VAL HHSV HIGH HIHI HSV LLSV LOLO LOW LSV PREC") } record(bo, "$(DEV):FREQ_SEARCH_IN_TOL") { field(DESC, "Freq search in tol") field(ZNAM, "Not OK") field(ZSV, "MINOR") field(ONAM, "OK") field(OSV, "NO_ALARM") # info(autosaveFields, "intentionally blank") } record( mbbo, "$(DEV):FREQ_SEARCH_STATE" ) { field( DESC, "Freq search state" ) field( VAL, "1" ) field( ZRVL, "0" ) field( ZRST, "Searching" ) field( ZRSV, "MINOR") field( ONVL, "1" ) field( ONST, "Idle" ) field( TWVL, "2" ) field( TWST, "Found" ) field( THVL, "3" ) field( THST, "Failed" ) field( THSV, "MAJOR" ) field( PINI, "YES" ) field( FLNK, "$(DEV):FREQ_SEARCH_ACTIVE" ) # info(autosaveFields, "intentionally blank") } record( calc, "$(DEV):FREQ_SEARCH_ACTIVE" ) { field(DESC, "Freq search in progress") field( INPA, "$(DEV):FREQ_SEARCH_STATE NPP MS" ) field( CALC, "0=A" ) # info(autosaveFields, "intentionally blank") } record( seq, "$(DEV):FREQ_SEARCH_START" ) { field(DESC, "Start frequency search") field(DOL1, "0") field(LNK1, "$(DEV):FREQ_RETRY_COUNTER PP") field(DLY2, "0.5") field( DOL2, "0" ) field( LNK2, "$(DEV):FREQ_SEARCH_STATE PP" ) # field( DOL2, "1" ) # field( LNK2, "$(DEV):FREQ_SEARCH_ACTIVE PP" ) } record( seq, "$(DEV):FREQ_SEARCH_STOP" ) { field( DESC, "Stop frequency search" ) field( DOL1, "1" ) field( LNK1, "$(DEV):FREQ_SEARCH_STATE PP" ) field( DOL2, "0" ) field( LNK2, "$(DEV):FREQ_RETRY_COUNTER PP" ) } record( calcout, "$(DEV):FREQ_DO_RETRY" ) { field(DESC, "Retry if not at freq") # If motor is done moving, initiate another retry field(INPA, "$(DEV):M1_MOTR_C.DMOV CA") field(CALC, "A==1") field( SCAN, "5 second" ) field(OOPT, "When Non-zero") field(DOPT, "Use OCAL") field(OCAL, "1") field(ODLY, "2.5") field(OUT, "$(DEV):FREQ_MOTOR_POS_GOTO.PROC") # Disabled when FREQ_SEARCH_ACTIVE is 0 field(DISV, "0") field(SDIS, "$(DEV):FREQ_SEARCH_ACTIVE") # info(autosaveFields, "intentionally blank") } # Is the frequency search within tolerance? record(calcout, "$(DEV):FREQ_SEARCH_IN_TOL_CALC") { field(DESC, "Frequency tolerance calc") field(VAL, "0") field(INPA, "$(DEV):FREQ_ERR_SMOOTHED CP MS") field(INPB, "$(DEV):FREQ_TOLERANCE NPP") field(CALC, "abs(A) <= B") field(OUT, "$(DEV):FREQ_SEARCH_IN_TOL PP") field(FLNK, "$(DEV):FREQ_SEARCH_MONITOR PP NMS") # info(autosaveFields, "intentionally blank") } # Monitor the frequency search and shut it down when done record(calcout, "$(DEV):FREQ_SEARCH_MONITOR") { field(DESC, "Monitor frequency search") field( INPA, "$(DEV):FREQ_SEARCH_IN_TOL NPP NMS" ) field( INPC, "$(DEV):M1_MOTR_C.DMOV NPP NMS" ) field( INPD, "$(DEV):FREQ_RETRY_COUNTER NPP NMS" ) field( INPE, "$(DEV):FREQ_RETRY_COUNTER.HIHI NPP NMS" ) field( INPF, "$(DEV):FREQ_ERR_LAST_N_STD NPP NMS" ) field( INPG, "$(DEV):FREQ_ERR_LAST_N_STD.HIHI NPP NMS" ) field( INPH, "$(DEV):FREQ_MOTOR_TGT NPP NMS" ) field( INPI, "$(DEV):M1_MOTR_C.HLM NPP NMS" ) field( INPJ, "$(DEV):M1_MOTR_C.LLM NPP NMS" ) field( CALC, "(A && C) || ((D>=E)||(F>G)||(H>I)||(H=E)||(F>G)||(H>I)||(H field( INPB, "" ) field( CALC, "A||B" ) } record(calcout, "$(DEV):PHASE_LOCKED_CALC") { field(INPA, "$(DEV):RF_LOCK_ENABLE CPP MS") field(INPB, "$(DEV):PIEZO_AMP_MON CPP MS") field(INPC, "$(DEV):PIEZO_AMP_MON.LOLO NPP NMS") field(INPD, "$(DEV):PIEZO_AMP_MON.HIHI NPP NMS") field(INPE, "$(DEV):CH1_RF_PWR CPP MS") field(INPF, "$(DEV):CH1_RF_PWR.LOLO NPP NMS") field(INPG, "$(DEV):CH1_DIODE_PWR CPP MS") field(INPH, "$(DEV):CH1_DIODE_PWR.LOLO NPP NMS") field(INPI, "$(DEV):FREQ_ERR PP MS") field(INPJ, "$(DEV):FREQ_ERR.HIHI NPP NMS") field(INPK, "$(DEV):CH1_CALC_PHASE_LAST_60_STD PP MS") field(INPL, "$(DEV):CH1_CALC_PHASE_LAST_60_STD.HIHI NPP NMS") field(CALC, "A=1&&B>C&&BF&&G>H&&ABS(I) AUTO_ON_LIMIT # and the chamber freq motor is not moving # but only if we're still locked to protect against runaway conditions record(calcout, "$(DEV):PID_COARSE_AUTO_ON") { field(DESC, "Enable coarse PID when too far") field( INPA, "$(DEV):PID_COARSE_FILT_ERR CP MS" ) field(INPB, "$(DEV):PID_COARSE_AUTO_ON_LIMIT CP MS") field(INPC, "$(DEV):M1_MOTR_C.DMOV") field(INPD, "$(DEV):PHASE_LOCKED CP MS") field(CALC, "(ABS(A)>B) && C=1 && D=1") field(OUT, "$(DEV):PID_COARSE.FBON") field(OOPT, "Transition To Non-zero") field(OCAL, "1") field(DISV, "0") field(SDIS, "$(DEV):AUTO_MODE_ENABLE") info(autosaveFields, "INPC") } # Disable PID when the piezo element is near it's center # ABS(piezo - center) < AUTO_OFF_LIMIT # or if we lose lock, so the motor doesn't walk off # or if the RF lock is disabled record(calcout, "$(DEV):PID_COARSE_AUTO_OFF") { field(DESC, "Disable coarse PID when at mean") field( INPA, "$(DEV):PID_COARSE_FILT_ERR CP MS" ) field(INPB, "$(DEV):PID_COARSE_AUTO_OFF_LIMIT CP MS") # field(INPC, "$(DEV):M1_MOTR_C.DMOV") field(INPD, "$(DEV):PHASE_LOCKED CP MS") field(CALC, "((ABS(A)B&&!D&&!E") field(OUT, "$(DEV):FREQ_SEARCH_START PP NMS") field(OOPT, "When Non-zero") field(DISV, "0") field(SDIS, "$(DEV):AUTO_MODE_ENABLE") } record(calcout, "$(DEV):AUTO_RF_LOCK_ENABLE_CALC") { field(DESC, "Auto RF Lock watcher") field(SCAN, "2 second") field(INPA, "$(DEV):CH1_DIODE_PWR_RMS NPP MS") field(INPB, "$(DEV):CH1_DIODE_PWR.LOLO NPP MS") field(INPC, "$(DEV):CH1_DIODE_PWR.HIHI NPP MS") field(INPD, "$(DEV):CH1_RF_PWR_RMS NPP MS") field(INPE, "$(DEV):CH1_RF_PWR.LOLO NPP MS") field(INPF, "$(DEV):CH1_RF_PWR.HIHI NPP MS") field(INPG, "$(DEV):FREQ_SEARCH_ACTIVE CP MS") field(CALC, "(A>B)&&(AE)&&(D