# # Base record set common to all pgpCamlink based cameras # # Required macros: # P - Prefix # R - Region, common camera PV prefix is $(P)$(R) # PORT - Asyn port name # PGP - Prefix for PGP PGP Rogue register IOC # PGP_LANE - Camera lane number on PGP framegrabber # Optional macros # TIMEOUT - Defaults to 1 sec # CAM_MODE - Base, Medium, or Full. Defaults to Base # # These are needed only if you want to use PV's w/ the CAM prefix # to set and monitor event code trigger timing. # TICK_DLY_SCALE - Scale factor for cam delay to timing system ticks, default 1000000000 for ns # TICK_DLY_EGU - EGU for tick delay values, defaults to ns # # These macros are typically not needed # For the Orca and other rolling shutter cameras whose shutter ramp time is # longer than the few ms advance notice before the beam arrives # you can specify an event code which will be used to filter camera images # acquired at 120hz regardless of beam rate # BEAM_EC - PV to set beam event code used to filter image acquisition # BEAM_EC_RBV - PV to get beam event code used to filter image acquisition # BEAM_RATE_RBV - PV to get beam event code rep rate in Hz # # Disable these records from ADBase.template as they are readback only based # on the current configuration and can only be changed by changing the config file record( mbbo, "$(P)$(R)DataType" ) { field( DISA, "1" ) } record( mbbo, "$(P)$(R)ColorMode" ) { field( DISA, "1" ) } # Disable AcquirePeriod from ADBase.template as the pgpCamlink framegrabber # and most camlink cameras don't support it # Camera models which support AcquirePeriod should set DISA back to 0 record( ao, "$(P)$(R)AcquirePeriod" ) { field( DISA, "1" ) } record( ai, "$(P)$(R)AcquirePeriod_RBV" ) { field( DISA, "1" ) } # Set severity for ADStateInitializing to MINOR to highlight when camera is reconfiguring record( mbbi, "$(P)$(R)DetectorState_RBV" ) { field( EISV, "MINOR" ) } # This record should be overridden in $MODEL.db, replacing "UknownModel" with # the chosen camera model. # PINI is NO here so PV status is UDF, but should be set to YES in $MODEL.db record( stringin, "$(P)$(R)CamModel" ) { field( VAL, "UnknownModel" ) field( PINI, "NO" ) } record( stringin, "$(P)$(R)CamModelScreen" ) { field( VAL, "ADPgpCamlinkScreens/UnknownModel.edl" ) field( PINI, "NO" ) } # The CamReConfigCount PV gets incremented each time the driver reconfigures the camera. # The FNLK record, CamReConfigSeq, should be implemented by each # camera model.db file to trigger processing of serial commands # to read camera settings and status. # Note: Serial commands for AcquireTime, TriggerMode, etc that get updated # in response to user changes to settings typically do not need to get # re-read in response to a reconfigure. record( longout, $(P)$(R)CamReConfigCount ) { # TODO: Implement support for tracking configuration count and CamReConfigSeq # field( DTYP, "asynInt32" ) # field( OUT, "@asyn($(PORT),$(ADDR=0),$(TIMEOUT=1))CAM_RECFG_CNT" ) # field( SCAN, "I/O Intr" ) field( FLNK, "$(P)$(R)CamReConfigSeq" ) } record( seq, $(P)$(R)CamReConfigSeq ) { } # Usefull PV for GUI visibility based on channel number (PGP_LANE) record( longin, "$(P)$(R)CamChannel" ) { field( VAL, "$(PGP_LANE)" ) field( PINI, "YES" ) } # # Camlink settings # record( longout, "$(P)$(R)CamlinkPixelClk" ) { field( OUT, "$(PGP):Ch$(PGP_LANE):Feb$(PGP_LANE):PixelClk CA" ) field( EGU, "MHz" ) field( PINI, "YES" ) info( autosaveFields, "" ) } record( longin, "$(P)$(R)CamlinkPixelClk_RBV" ) { field( INP, "$(PGP):Ch$(PGP_LANE):Feb$(PGP_LANE):PixelClk CPP MS" ) } record( longout, "$(P)$(R)CamlinkBaudRate" ) { field( OUT, "$(PGP):Ch$(PGP_LANE):Feb$(PGP_LANE):BaudRate CA" ) field( EGU, "bps" ) info( autosaveFields, "" ) } record( longin, "$(P)$(R)CamlinkBaudRate_RBV" ) { field( INP, "$(PGP):Ch$(PGP_LANE):Feb$(PGP_LANE):BaudRate_RBV CPP MS" ) } # CameraLink Mode # 0: 'Disable', 1: 'Base', 2: 'Medium', 3: 'Full', 4: 'Deca' record( mbbo, "$(P)$(R)CamlinkLinkMode" ) { field( OUT, "$(PGP):Ch$(PGP_LANE):Feb$(PGP_LANE):LinkMode CA" ) field( ZRVL, "0" ) field( ZRST, "Disable" ) field( ONVL, "1" ) field( ONST, "Base" ) field( TWVL, "2" ) field( TWST, "Medium" ) field( THVL, "3" ) field( THST, "Full" ) field( FRVL, "4" ) field( FRST, "Deca" ) } record( mbbi, "$(P)$(R)CamlinkLinkMode_RBV" ) { field( INP, "$(PGP):Ch$(PGP_LANE):Feb$(PGP_LANE):LinkMode_RBV CPP MS" ) field( ZRVL, "0" ) field( ZRST, "Disable" ) field( ONVL, "1" ) field( ONST, "Base" ) field( TWVL, "2" ) field( TWST, "Medium" ) field( THVL, "3" ) field( THST, "Full" ) field( FRVL, "4" ) field( FRST, "Deca" ) } # Camlink Data Mode (# bits per pixel) # 0: 'None', 1: '8Bit', 2: '10Bit', 3: '12Bit', # 4: '14Bit', 5: '16Bit', 6: '24Bit', 7: '30Bit', 8: '36Bit' record( mbbo, "$(P)$(R)CamlinkDataMode" ) { field( OUT, "$(PGP):Ch$(PGP_LANE):Feb$(PGP_LANE):DataMode CA" ) field( ZRVL, "0" ) field( ZRST, "None" ) field( ONVL, "1" ) field( ONST, "8 Bit" ) field( TWVL, "2" ) field( TWST, "10 Bit" ) field( THVL, "3" ) field( THST, "12 Bit" ) field( FRVL, "4" ) field( FRST, "14 Bit" ) field( FVVL, "5" ) field( FVST, "16 Bit" ) field( SXVL, "6" ) field( SXST, "24 Bit" ) field( SVVL, "7" ) field( SVST, "30 Bit" ) field( EIVL, "8" ) field( EIST, "36 Bit" ) } record( longin, "$(P)$(R)CamlinkDataMode_RBV" ) { field( INP, "$(PGP):Ch$(PGP_LANE):Feb$(PGP_LANE):DataMode_RBV CPP MS" ) } # Camlink Frame Mode # 0: 'None', 1: 'Line', 2: 'Frame' record( mbbo, "$(P)$(R)CamlinkFrameMode" ) { field( OUT, "$(PGP):Ch$(PGP_LANE):Feb$(PGP_LANE):FrameMode CA" ) field( ZRVL, "0" ) field( ZRST, "None" ) field( ONVL, "1" ) field( ONST, "Line" ) field( TWVL, "2" ) field( TWST, "Frame" ) } record( longin, "$(P)$(R)CamlinkFrameMode_RBV" ) { field( INP, "$(PGP):Ch$(PGP_LANE):Feb$(PGP_LANE):FrameMode_RBV CPP MS" ) } # DOL field set in $MODEL.template record( longout, "$(P)$(R)CamlinkHTap" ) { field( DESC, "Camlink horizontal taps" ) field( PINI, "YES" ) field( OUT, "$(PGP):Ch$(PGP_LANE):Feb$(PGP_LANE):TapCount CA" ) } record( longin, "$(P)$(R)CamlinkHTap_RBV" ) { field( INP, "$(PGP):Ch$(PGP_LANE):Feb$(PGP_LANE):TapCount_RBV CPP MS" ) } record( longout, "$(P)$(R)CamlinkVTap" ) { field( DESC, "Camlink vertical taps" ) field( DOL, "1" ) field( OMSL, "closed_loop" ) field( PINI, "YES" ) # field( OUT, "$(PGP):Ch$(PGP_LANE):Feb$(PGP_LANE):VTapCount CA" ) } record( longin, "$(P)$(R)CamlinkVTap_RBV" ) { # field( INP, "$(PGP):Ch$(PGP_LANE):Feb$(PGP_LANE):VTapCount_RBV CPP MS" ) field( INP, "$(P)$(R)CamlinkVTap CPP MS" ) } record( longout, "$(P)$(R)CamlinkTrigMask" ) { field( DESC, "Sets trigger mask on 4-bit camCtrl bus" ) field( OUT, "$(PGP):Ch$(PGP_LANE):Feb$(PGP_LANE):TrigMask CA" ) } record( longin, "$(P)$(R)CamlinkTrigMask_RBV" ) { field( INP, "$(PGP):Ch$(PGP_LANE):Feb$(PGP_LANE):TrigMask_RBV CPP MS" ) } record( bo, "$(P)$(R)CamlinkInvCC" ) { field( OUT, "$(PGP):Ch$(PGP_LANE):Feb$(PGP_LANE):InvCC CA" ) field( ZNAM, "Normal" ) field( ONAM, "Invert" ) } record( longin, "$(P)$(R)CamlinkInvCC_RBV" ) { field( INP, "$(PGP):Ch$(PGP_LANE):Feb$(PGP_LANE):InvCC_RBV CPP MS" ) } record( longout, "$(P)$(R)CamlinkHActive" ) { field( OUT, "$(PGP):Ch$(PGP_LANE):Feb$(PGP_LANE):HActive CA" ) field( EGU, "px" ) field( PINI, "YES" ) info( autosaveFields, "HHSV HIGH HIHI HSV LLSV LOLO LOW LSV DESC HOPR LOPR" ) } record( longin, "$(P)$(R)CamlinkHActive_RBV" ) { field( INP, "$(PGP):Ch$(PGP_LANE):Feb$(PGP_LANE):HActive_RBV CPP MS" ) field( EGU, "px" ) info( autosaveFields, "HHSV HIGH HIHI HSV LLSV LOLO LOW LSV DESC HOPR LOPR" ) } record( longout, "$(P)$(R)CamlinkVActive" ) { field( OUT, "$(PGP):Ch$(PGP_LANE):Feb$(PGP_LANE):VActive CA" ) field( EGU, "px" ) field( PINI, "YES" ) info( autosaveFields, "HHSV HIGH HIHI HSV LLSV LOLO LOW LSV DESC HOPR LOPR" ) } record( longin, "$(P)$(R)CamlinkVActive_RBV" ) { field( INP, "$(PGP):Ch$(PGP_LANE):Feb$(PGP_LANE):VActive_RBV CPP MS" ) field( EGU, "px" ) info( autosaveFields, "HHSV HIGH HIHI HSV LLSV LOLO LOW LSV DESC HOPR LOPR" ) } record( longout, "$(P)$(R)CamlinkHSkip" ) { field( OUT, "$(PGP):Ch$(PGP_LANE):Feb$(PGP_LANE):HSkip CA" ) field( EGU, "px" ) field( PINI, "YES" ) info( autosaveFields, "HHSV HIGH HIHI HSV LLSV LOLO LOW LSV DESC HOPR LOPR VAL" ) } record( longin, "$(P)$(R)CamlinkHSkip_RBV" ) { field( INP, "$(PGP):Ch$(PGP_LANE):Feb$(PGP_LANE):HSkip_RBV CPP MS" ) field( EGU, "px" ) info( autosaveFields, "HHSV HIGH HIHI HSV LLSV LOLO LOW LSV DESC HOPR LOPR" ) } record( longout, "$(P)$(R)CamlinkVSkip" ) { field( OUT, "$(PGP):Ch$(PGP_LANE):Feb$(PGP_LANE):VSkip CA" ) field( EGU, "px" ) field( PINI, "YES" ) info( autosaveFields, "HHSV HIGH HIHI HSV LLSV LOLO LOW LSV DESC HOPR LOPR VAL" ) } record( longin, "$(P)$(R)CamlinkVSkip_RBV" ) { field( INP, "$(PGP):Ch$(PGP_LANE):Feb$(PGP_LANE):VSkip_RBV CPP MS" ) field( EGU, "px" ) info( autosaveFields, "HHSV HIGH HIHI HSV LLSV LOLO LOW LSV DESC HOPR LOPR" ) } # # Propagate these PVs through the CAM interface record( ao, "$(P)$(R)AcquireTime" ) { # field( TPRO, "2" ) field( DOL, "0.001" ) field( VAL, "0.001" ) field( FLNK, "$(P)$(R)CamAcquireTime" ) info( autosaveFields, "PREC VAL HIHI HIGH LOW LOLO HHSV HSV LSV LLSV" ) } # CamAcquireTime (Exposure Time) # This record updates the asyn serial driver record( ao, "$(P)$(R)CamAcquireTime" ) { field( DOL, "$(P)$(R)AcquireTime NPP MS" ) field( OMSL, "closed_loop" ) field( PREC, "5" ) field( EGU, "sec" ) info( autosaveFields, "PREC VAL HIHI HIGH LOW LOLO HHSV HSV LSV LLSV" ) } record( calcout, "$(P)$(R)CamAcquireTimeCalc" ) { # field( TPRO, 2 ) field( INPA, "$(CAM):AcquireTime CPP MS" ) # field( INPB, "$(CAM):CamDelayScale NPP MS" ) field( INPB, "1000000" ) field( CALC, "FLOOR(A*B)" ) field( PREC, "4" ) field( EGU, "us" ) field( OUT, "$(PGP):Ch$(PGP_LANE):Feb$(PGP_LANE):PulseWidth CA" ) info( archiveFields, "VAL" ) info( autosaveFields, "PREC VAL HIHI HIGH LOW LOLO HHSV HSV LSV LLSV" ) } # CamAcquireTime_RBV (Exposure Time) # This record updates the asyn serial driver # which maps it to ADCore's ADAcquireTime parameter record( calc, "$(P)$(R)CamAcquireTime_RBV" ) { field( INPA, "$(PGP):Ch$(PGP_LANE):Feb$(PGP_LANE):PulseWidth_RBV CPP MS" ) # field( INPB, "$(CAM):CamDelayScale NPP MS" ) field( INPB, "1000000" ) field( CALC, "A/B" ) field( EGU, "sec" ) field( PREC, "4" ) # field( TPRO, "2" ) field( FLNK, "$(P)$(R)AcquireTime_RBV" ) info( autosaveFields, "PREC VAL HIHI HIGH LOW LOLO HHSV HSV LSV LLSV" ) } # Update ADCore AcquireTime_RBV from CamAcquireTime_RBV # This overrides the default precision for the # ADCore AcquireTime readback record( ai, "$(P)$(R)AcquireTime_RBV" ) { field( PREC, "5" ) field( DTYP, "Soft Channel" ) field( INP, "$(P)$(R)CamAcquireTime_RBV NPP MS" ) field( SCAN, "Passive" ) # field( TPRO, "2" ) info( autosaveFields, "PREC VAL HIHI HIGH LOW LOLO HHSV HSV LSV LLSV" ) } # # Handle framegrabber hardware ROI Min and Size for X and Y dimensions # # Note: CamMinX is a longin record instead of longout, while # CamMinX_RBV is longout. This is the opposite pattern of most # ADCore record names, as these are used to communicate ROI settings between # ADCore, framegrabber API, and the camera specific ROI PV's. # Same logic applies to the other HW ROI related PV's record( longout, "$(P)$(R)MinX" ) { field( FLNK, "$(P)$(R)CamMinX" ) } record( longin, "$(P)$(R)CamMinX" ) { field( DTYP, "asynInt32" ) field( INP, "@asyn($(PORT),$(ADDR=0),$(TIMEOUT=1))CLCAM_MIN_X" ) field( SCAN, "I/O Intr" ) info( autosaveFields, "" ) } record( longout, "$(P)$(R)CamMinX_RBV" ) { field( DTYP, "asynInt32" ) field( OMSL, "closed_loop" ) field( DOL, "$(P)$(R)CamMinX CPP MS" ) field( OUT, "@asyn($(PORT),$(ADDR=0),$(TIMEOUT=1))CLCAM_MIN_X" ) field( FLNK, "$(P)$(R)MinX_RBV" ) } record( longout, "$(P)$(R)BinX" ) { field( FLNK, "$(P)$(R)CamBinX" ) } record( longin, "$(P)$(R)CamBinX" ) { field( DTYP, "asynInt32" ) field( INP, "@asyn($(PORT),$(ADDR=0),$(TIMEOUT=1))CLCAM_BIN_X" ) field( SCAN, "I/O Intr" ) info( autosaveFields, "" ) } record( longout, "$(P)$(R)CamBinX_RBV" ) { field( DTYP, "asynInt32" ) field( OMSL, "closed_loop" ) field( DOL, "$(P)$(R)CamBinX CPP MS" ) field( OUT, "@asyn($(PORT),$(ADDR=0),$(TIMEOUT=1))CLCAM_BIN_X" ) field( FLNK, "$(P)$(R)BinX_RBV" ) } record( longout, "$(P)$(R)SizeX" ) { field( FLNK, "$(P)$(R)CamSizeX" ) } record( longin, "$(P)$(R)CamSizeX" ) { field( DTYP, "asynInt32" ) field( INP, "@asyn($(PORT),$(ADDR=0),$(TIMEOUT=1))CLCAM_SIZE_X" ) field( SCAN, "I/O Intr" ) info( autosaveFields, "" ) } record( longout, "$(P)$(R)CamSizeX_RBV" ) { field( DTYP, "asynInt32" ) field( OMSL, "closed_loop" ) field( DOL, "$(P)$(R)CamSizeX CPP MS" ) field( OUT, "@asyn($(PORT),$(ADDR=0),$(TIMEOUT=1))CLCAM_SIZE_X" ) field( FLNK, "$(P)$(R)SizeX_RBV" ) info( autosaveFields, "" ) } record( longout, "$(P)$(R)MinY" ) { field( FLNK, "$(P)$(R)CamMinY" ) } record( longin, "$(P)$(R)CamMinY" ) { field( DTYP, "asynInt32" ) field( INP, "@asyn($(PORT),$(ADDR=0),$(TIMEOUT=1))CLCAM_MIN_Y" ) field( SCAN, "I/O Intr" ) info( autosaveFields, "" ) } record( longout, "$(P)$(R)CamMinY_RBV" ) { field( DTYP, "asynInt32" ) field( OMSL, "closed_loop" ) field( DOL, "$(P)$(R)CamMinY CPP MS" ) field( OUT, "@asyn($(PORT),$(ADDR=0),$(TIMEOUT=1))CLCAM_MIN_Y" ) field( FLNK, "$(P)$(R)MinY_RBV" ) info( autosaveFields, "" ) } record( longout, "$(P)$(R)BinY" ) { field( FLNK, "$(P)$(R)CamBinY" ) } record( longin, "$(P)$(R)CamBinY" ) { field( DTYP, "asynInt32" ) field( INP, "@asyn($(PORT),$(ADDR=0),$(TIMEOUT=1))CLCAM_BIN_Y" ) field( SCAN, "I/O Intr" ) info( autosaveFields, "" ) } record( longout, "$(P)$(R)CamBinY_RBV" ) { field( DTYP, "asynInt32" ) field( OMSL, "closed_loop" ) field( DOL, "$(P)$(R)CamBinY CPP MS" ) field( OUT, "@asyn($(PORT),$(ADDR=0),$(TIMEOUT=1))CLCAM_BIN_Y" ) field( FLNK, "$(P)$(R)BinY_RBV" ) info( autosaveFields, "" ) } record( longout, "$(P)$(R)SizeY" ) { field( FLNK, "$(P)$(R)CamSizeY" ) } record( longin, "$(P)$(R)CamSizeY" ) { field( DTYP, "asynInt32" ) field( INP, "@asyn($(PORT),$(ADDR=0),$(TIMEOUT=1))CLCAM_SIZE_Y" ) field( SCAN, "I/O Intr" ) info( autosaveFields, "" ) } record( longout, "$(P)$(R)CamSizeY_RBV" ) { field( DTYP, "asynInt32" ) field( OMSL, "closed_loop" ) field( DOL, "$(P)$(R)CamSizeY CPP MS" ) field( OUT, "@asyn($(PORT),$(ADDR=0),$(TIMEOUT=1))CLCAM_SIZE_Y" ) field( FLNK, "$(P)$(R)SizeY_RBV" ) info( autosaveFields, "" ) } # Used to configure whether camera has HW ROI or not # Most camlink cameras do not so HW ROI happens in the framegrabber # by reading out less than the full image. This does not # increase frame rates as the entire image is still being sent # over the camlink connection. # TODO: Some cameras such as Pulnix have 2 or 3 preconfigured # ROI readout modes that could be used but would probably require # some custom driver coding. record( longout, "$(P)$(R)CamHwHROI_RBV" ) { field( OMSL, "closed_loop" ) field( VAL, "0" ) # field( DTYP, "asynInt32" ) # field( OUT, "@asyn($(PORT),$(ADDR=0),$(TIMEOUT=1))CLCAM_HW_VROI" ) field( PINI, "YES" ) info( archiveFields, "VAL" ) } # Used to configure whether camera has HW ROI or not # Most camlink cameras do not record( longout, "$(P)$(R)CamHwVROI_RBV" ) { field( OMSL, "closed_loop" ) field( VAL, "0" ) # field( DTYP, "asynInt32" ) # field( OUT, "@asyn($(PORT),$(ADDR=0),$(TIMEOUT=1))CLCAM_HW_VROI" ) field( PINI, "YES" ) info( archiveFields, "VAL" ) } record( mbbo, "$(P)$(R)CamMode" ) { field( OUT, "$(P)$(R)CamlinkLinkMode PP" ) field( ZRVL, "0" ) field( ZRST, "Disable" ) field( ONVL, "1" ) field( ONST, "Base" ) field( TWVL, "2" ) field( TWST, "Medium" ) field( THVL, "3" ) field( THST, "Full" ) field( FRVL, "4" ) field( FRST, "Deca" ) # field( SCAN, "I/O Intr" ) info( archiveFields, "VAL" ) } record( stringin, "$(P)$(R)CamDrvVersion" ) { field( DTYP, "asynOctetRead" ) field( INP, "@asyn($(PORT),$(ADDR=0),$(TIMEOUT=1))CLCAM_DRV_VERSION" ) field( SCAN, "I/O Intr" ) field( PINI, "YES" ) info( archiveFields, "VAL" ) } record( stringin, "$(P)$(R)CamLibVersion" ) { field( DTYP, "asynOctetRead" ) field( INP, "@asyn($(PORT),$(ADDR=0),$(TIMEOUT=1))CLCAM_LIB_VERSION" ) field( SCAN, "I/O Intr" ) field( PINI, "YES" ) info( archiveFields, "VAL" ) } record( stringin, "$(P)$(R)CamInfo" ) { field( DTYP, "asynOctetRead" ) field( INP, "@asyn($(PORT),$(ADDR=0),$(TIMEOUT=1))CLCAM_INFO" ) field( SCAN, "I/O Intr" ) info( archiveFields, "VAL" ) } record( mbbi, "$(P)$(R)CamOverrun" ) # Do we need this? { # field( DTYP, "asynInt32" ) # field( INP, "@asyn($(PORT),$(ADDR=0),$(TIMEOUT=1))CLCAM_OVERRUN" ) field( ZRST, "OK" ) field( ZRVL, "0" ) field( ZRSV, "NO_ALARM" ) field( ONST, "Overrun" ) field( ONVL, "1" ) field( ONSV, "MAJOR" ) # field( SCAN, "I/O Intr" ) } record( longout, "$(P)$(R)CamDebugLevel" ) { field( DTYP, "asynInt32" ) field( OUT, "@asyn($(PORT),$(ADDR=0),$(TIMEOUT=1))CLCAM_DEBUG" ) field( PINI, "YES" ) field( DOL, "0" ) field( FLNK, "$(P)$(R)CamDebugLevel_RBV" ) } record( longin, "$(P)$(R)CamDebugLevel_RBV" ) { field( DTYP, "asynInt32" ) field( INP, "@asyn($(PORT),$(ADDR=0),$(TIMEOUT=1))CLCAM_DEBUG" ) field( SCAN, "I/O Intr" ) } record( longout, "$(P)$(R)CamDebugSerLevel" ) { field( DTYP, "asynInt32" ) field( OUT, "@asyn($(PORT),$(ADDR=0),$(TIMEOUT=1))CLCAM_DEBUG_SER" ) field( PINI, "YES" ) field( DOL, "0" ) field( FLNK, "$(P)$(R)CamDebugSerLevel_RBV" ) } record( longin, "$(P)$(R)CamDebugSerLevel_RBV" ) { field( DTYP, "asynInt32" ) field( INP, "@asyn($(PORT),$(ADDR=0),$(TIMEOUT=1))CLCAM_DEBUG_SER" ) field( SCAN, "I/O Intr" ) } record( longout, "$(P)$(R)CamHSkip" ) { field( DTYP, "asynInt32" ) field( OUT, "@asyn($(PORT),$(ADDR=0),$(TIMEOUT=1))CLCAM_HSKIP" ) } record( longout, "$(P)$(R)CamHSize" ) { field( DTYP, "asynInt32" ) field( OUT, "@asyn($(PORT),$(ADDR=0),$(TIMEOUT=1))CLCAM_HSIZE" ) } record( longout, "$(P)$(R)CamVSkip" ) { field( DTYP, "asynInt32" ) field( OUT, "@asyn($(PORT),$(ADDR=0),$(TIMEOUT=1))CLCAM_VSKIP" ) } record( longout, "$(P)$(R)CamVSize" ) { field( DTYP, "asynInt32" ) field( OUT, "@asyn($(PORT),$(ADDR=0),$(TIMEOUT=1))CLCAM_VSIZE" ) } record( mbbo, "$(P)$(R)CamTrigLevel" ) { field( DTYP, "asynInt32" ) field( OUT, "@asyn($(PORT),$(ADDR=0),$(TIMEOUT=1))CLCAM_TRIG_LEVEL" ) field( PINI, "YES" ) field( ZRST, "Edge" ) field( ZRVL, "0" ) field( ONST, "Level" ) field( ONVL, "1" ) field( TWST, "Sync" ) field( TWVL, "2" ) info( autosaveFields, "VAL" ) info( archiveFields, "VAL" ) } #record( mbbi, "$(P)$(R)CamTrigLevel_RBV" ) #{ # field( DTYP, "asynInt32" ) # field( INP, "@asyn($(PORT),$(ADDR=0),$(TIMEOUT=1))CLCAM_TRIG_LEVEL" ) # field( PINI, "YES" ) # field( ZRST, "Edge" ) # field( ZRVL, "0" ) # field( ONST, "Level" ) # field( ONVL, "1" ) # field( TWST, "Sync" ) # field( TWVL, "2" ) # field( SCAN, "I/O Intr" ) # info( archiveFields, "VAL" ) #} # Replace ADBase TriggerMode fields w/ pgpCamlink specific options record( mbbo, "$(P)$(R)TriggerMode" ) { # field( TPRO, 2 ) field( DOL, "2" ) field( PINI, "YES" ) field( ZRVL, "0" ) field( ZRST, "FreeRun" ) field( ONVL, "1" ) field( ONST, "External" ) field( TWVL, "2" ) field( TWST, "Pulse" ) field( FLNK, "$(P)$(R)CamTriggerMode" ) } # Replace ADBase TriggerMode_RBV fields w/ pgpCamlink options record( mbbi, "$(P)$(R)TriggerMode_RBV" ) { # field( TPRO, 2 ) field( ZRVL, "0" ) field( ZRST, "FreeRun" ) field( ONVL, "1" ) field( ONST, "External" ) field( TWVL, "2" ) field( TWST, "Pulse" ) } record( mbbo, "$(P)$(R)CamTriggerMode" ) { # field( TPRO, 2 ) field( DOL, "$(P)$(R)TriggerMode NPP NMS" ) field( OMSL, "closed_loop" ) field( DTYP, "asynInt32" ) field( OUT, "@asyn($(PORT),$(ADDR=0),$(TIMEOUT=1))CLCAM_TRIGGER_MODE" ) field( ZRVL, "0" ) field( ZRST, "FreeRun" ) field( ONVL, "1" ) field( ONST, "External" ) field( TWVL, "2" ) field( TWST, "Pulse" ) field( FLNK, "$(P)$(R)CamTriggerMode_RBV" ) info( archiveFields, "DESC" ) } record( mbbi, "$(P)$(R)CamTriggerMode_RBV" ) { # field( TPRO, 2 ) field( DTYP, "asynInt32" ) field( INP, "@asyn($(PORT),$(ADDR=0),$(TIMEOUT=1))CLCAM_TRIGGER_MODE" ) field( ZRVL, "0" ) field( ZRST, "FreeRun" ) field( ONVL, "1" ) field( ONST, "External" ) field( TWVL, "2" ) field( TWST, "Pulse" ) field( FLNK, "$(P)$(R)TriggerMode_RBV" ) info( archiveFields, "DESC" ) } # TODO: Add Pulse Width based AcquireTime support here # # The following PV's are needed only if you want to use CAM PV's to set # and monitor event code trigger timing, in which case be sure to set # the required macros listed at the top of this file # record( ao, "$(CAM):CamTrigDelay" ) { #field( TPRO, "$(TPRO=2)" ) field( PREC, "4" ) field( EGU, "sec" ) field( PINI, "YES" ) field( FLNK, "$(CAM):CamTrigDelayCalc" ) info( autosaveFields, "PREC HHSV HIGH HIHI HSV LLSV LOLO LOW LSV DESC HOPR LOPR PREC VAL" ) info( archiveFields, "EGU HOPR LOPR VAL" ) } # This record calculates the trigger delay and writes it to the # appropriate EVR record via macro CAM_DLY record( calcout, "$(CAM):CamTrigDelayCalc" ) { field( INPA, "$(CAM):CamTrigDelay NPP MS" ) # field( INPB, "$(CAM):CamDelayScale NPP MS" ) field( INPB, "125000000" ) field( CALC, "MAX(0,MIN(A*B,0xFFFFFF))" ) field( OOPT, "On Change" ) field( OUT, "$(PGP):Ch$(PGP_LANE):EvrV2:TriggerDelay CA NMS" ) field( EGU, "1/125MHz" ) field( PREC, "4" ) info( autosaveFields, "PREC HHSV HIGH HIHI HSV LLSV LOLO LOW LSV DESC PREC" ) info( archiveFields, "EGU VAL" ) } record( longout, "$(CAM):CamDelayScale" ) { field( DOL, "$(CAM_DLY_SCALE=1000000)" ) field( EGU, "$(CAM_DLY_EGU=us)" ) field( PINI, "YES" ) field( FLNK, "$(CAM):CamTrigDelayCalc" ) info( autosaveFields, "" ) info( archiveFields, "EGU VAL" ) } record( calcout, "$(CAM):CamTrigDelay_RBV" ) { #field( TPRO, "$(TPRO=2)" ) field( INPA, "$(PGP):Ch$(PGP_LANE):EvrV2:TriggerDelay_RBV CPP MS" ) # field( INPB, "$(CAM):CamDelayScale CP MS" ) field( INPB, "125000000" ) field( CALC, "B==0?A:(A/B)" ) field( EGU, "sec" ) field( PREC, "4" ) field( OOPT, "On Change" ) info( autosaveFields, "PREC HHSV HIGH HIHI HSV LLSV LOLO LOW LSV DESC HOPR LOPR PREC VAL" ) info( archiveFields, "EGU VAL" ) } record( longout, "$(P)$(R)CamEventCode" ) { #field(TPRO,2) field( DOL, "45" ) field( OUT, "$(PGP):Ch$(PGP_LANE):Lcls1:RateSel CA NMS" ) field( PINI, "YES" ) info( autosaveFields, "HHSV HIGH HIHI HSV LLSV LOLO LOW LSV EGU DESC HOPR LOPR VAL" ) info( autosaveFields_pass1, "VAL" ) info( archiveFields, "VAL" ) } record( mbbo, "$(P)$(R)CamLcls2RateSel" ) { #field(TPRO,2) field( DOL, "0" ) field( OUT, "$(PGP):Ch$(PGP_LANE):Lcls2:RateSel CA NMS" ) field(ZRVL, "0") field(ONVL, "1") field(TWVL, "2") field(THVL, "3") field(FRVL, "4") field(FVVL, "5") field(SXVL, "6") field(ZRST, "1Hz") field(ONST, "10Hz") field(TWST, "100Hz") field(THST, "1kHz") field(FRST, "10kHz") field(FVST, "71.5kHz") field(SXST, "1MHz") field( PINI, "YES" ) info( autosaveFields, "DESC VAL" ) info( archiveFields, "VAL" ) } record( mbbi, "$(P)$(R)CamLcls2RateSel_RBV" ) { field( INP, "$(PGP):Ch$(PGP_LANE):Lcls2:RateSel CPP MS" ) field(ZRVL, "0") field(ONVL, "1") field(TWVL, "2") field(THVL, "3") field(FRVL, "4") field(FVVL, "5") field(SXVL, "6") field(ZRST, "1Hz") field(ONST, "10Hz") field(TWST, "100Hz") field(THST, "1kHz") field(FRST, "10kHz") field(FVST, "71.5kHz") field(SXST, "1MHz") info( autosaveFields, "DESC VAL" ) info( archiveFields, "VAL" ) } # Put monitors substitute "SER_OK_PV=$(PGP):Ch$(PGP_LANE):EvrV2:RateSel_RBV" substitute "MON_SCAN=1 second" substitute "MON_DISABLED=1" #? # CamEventCode_RBV follows the PGP EvrV2:RateSel_RBV, so it #? # sometimes follows Lcls2 timing, while CamEventCode is only for Lcls1 timing. substitute "MON_VALUE=1" substitute "MON_PV=$(P)$(R)CamEventCode" include "putMonitor.template" substitute "MON_PV=$(P)$(R)CamLcls2RateSel" include "putMonitor.template" substitute "SER_OK_PV=$(PGP):Ch$(PGP_LANE):PgpMon:RxRemLinkReady_RBV" substitute "MON_PV=$(P)$(R)CamlinkPixelClk" include "putMonitor.template" substitute "MON_PV=$(P)$(R)CamlinkBaudRate" include "putMonitor.template" substitute "MON_PV=$(P)$(R)CamlinkDataMode" include "putMonitor.template" substitute "MON_PV=$(P)$(R)CamlinkFrameMode" include "putMonitor.template" substitute "MON_PV=$(P)$(R)CamlinkLinkMode" include "putMonitor.template" substitute "MON_PV=$(P)$(R)CamlinkTrigMask" include "putMonitor.template" substitute "MON_PV=$(P)$(R)CamlinkInvCC" include "putMonitor.template" #substitute "MON_PV=$(PGP):Ch$(PGP_LANE):EventBuilder:Bypass" #include "putMonitor.template" substitute "MON_PV=$(P)$(R)CamlinkHTap" include "putMonitor.template" substitute "MON_PV=$(P)$(R)CamlinkHActive" include "putMonitor.template" substitute "MON_PV=$(P)$(R)CamlinkVActive" include "putMonitor.template" substitute "MON_PV=$(P)$(R)CamlinkHSkip" include "putMonitor.template" substitute "MON_PV=$(P)$(R)CamlinkVSkip" include "putMonitor.template" record( longin, "$(P)$(R)CamEventCode_RBV" ) { field( INP, "$(PGP):Ch$(PGP_LANE):Lcls1:RateSel CPP MS" ) info( autosaveFields, "HHSV HIGH HIHI HSV LLSV LOLO LOW LSV EGU DESC" ) info( archiveFields, "VAL" ) } record( ai, "$(P)$(R)CamRepRate_RBV" ) { field( INP, "$(PGP):Ch$(PGP_LANE):Feb$(PGP_LANE):TrigRate_RBV CPP MS" ) field( EGU, "Hz" ) field( PREC, "1" ) field( FLNK, "$(P)$(R)CamRepDur" ) info( autosaveFields, "HHSV HIGH HIHI HSV LLSV LOLO LOW LSV EGU DESC PREC" ) info( archiveFields, "VAL" ) } record( calc, "$(P)$(R)CamRepDur" ) { field( INPA, "$(P)$(R)CamRepRate_RBV CPP MS" ) field( CALC, "A==0?10:(1/A)" ) field( EGU, "sec" ) field( PREC, "3" ) info( autosaveFields, "HHSV HIGH HIHI HSV LLSV LOLO LOW LSV EGU DESC PREC" ) info( archiveFields, "EGU VAL" ) } # # For rolling shutter MODEL.db, set these fields as appropriate # field( PINI, "YES" ) #record( longout, "$(P)$(R)BeamEventCode" ) { # field( OUT, "$(BEAM_EC=$(P)$(R)CamEventCode) CA NMS" ) } #record( longin, "$(P)$(R)BeamEventCode_RBV" ) { # field( INP, "$(BEAM_EC_RBV=$(P)$(R)CamEventCode_RBV) CPP MS" ) } #record( ai, "$(P)$(R)BeamRepRate_RBV" ) { # field( INP, "$(BEAM_RATE_RBV=$(P)$(R)CamRepRate_RBV) CPP MS" ) } # info( autosaveFields, "HHSV HIGH HIHI HSV LLSV LOLO LOW LSV EGU DESC HOPR LOPR VAL" ) # # By default this beam event code is disabled, not autosaved and # PINI is NO so it can be safely ignored and not visible on the user GUI # Similarly, the RBV values default to following their camera trigger equivalents # record( longout, "$(P)$(R)BeamEventCode" ) { field( DOL, "40" ) field( PINI, "NO" ) field( OUT, "$(P)$(R)CamEventCode CA NMS" ) field( DISA, "1" ) info( autosaveFields, "HHSV HIGH HIHI HSV LLSV LOLO LOW LSV EGU DESC HOPR LOPR" ) info( archiveFields, "VAL" ) } record( longin, "$(P)$(R)BeamEventCode_RBV" ) { field( INP, "$(P)$(R)CamEventCode_RBV CPP MS" ) info( autosaveFields, "HHSV HIGH HIHI HSV LLSV LOLO LOW LSV EGU DESC HOPR LOPR" ) info( archiveFields, "VAL" ) } record( ai, "$(P)$(R)BeamRepRate_RBV" ) { field( INP, "$(P)$(R)CamRepRate_RBV CPP MS" ) field( EGU, "Hz" ) field( PREC, "1" ) field( FLNK, "$(P)$(R)BeamRepDur" ) info( autosaveFields, "HHSV HIGH HIHI HSV LLSV LOLO LOW LSV EGU DESC PREC" ) info( archiveFields, "VAL" ) } record( calc, "$(P)$(R)BeamRepDur" ) { field( INPA, "$(P)$(R)BeamRepRate_RBV CPP MS" ) field( CALC, "A==0?10:(1/A)" ) field( EGU, "sec" ) field( PREC, "3" ) info( autosaveFields, "HHSV HIGH HIHI HSV LLSV LOLO LOW LSV EGU DESC PREC" ) info( archiveFields, "VAL" ) }