Build Instructions for apertureSlits

Build Instructions for apertureSlits

  1. Add the dependencies to configure/RELEASE.

    PMACCOORD=/dls_sw/prod/R3.14.11/support/pmacCoord/1-11
    TPMAC=/dls_sw/prod/R3.14.11/support/tpmac/3-10dls7
    ASYN=/dls_sw/prod/R3.14.11/support/asyn/4-17
    STREAMDEVICE=/dls_sw/prod/R3.14.11/support/streamDevice/2-5
    MOTOR=/dls_sw/prod/R3.14.11/support/motor/6-7-1dls2
    

  2. Add the DBD dependencies to src/Makefile

    apertureSlits_DBD += base.dbd
    apertureSlits_DBD += asyn.dbd
    apertureSlits_DBD += pmacAsynIPPort.dbd
    apertureSlits_DBD += motorSupport.dbd
    apertureSlits_DBD += devSoftMotor.dbd
    apertureSlits_DBD += pmacAsynMotor.dbd
    apertureSlits_DBD += stream.dbd
    apertureSlits_DBD += pmacAsynCoord.dbd
    

  3. Add the LIBS dependencies to src/Makefile

    apertureSlits_LIBS += pmacAsynCoord
    apertureSlits_LIBS += stream
    apertureSlits_LIBS += pcre
    apertureSlits_LIBS += pmacAsynMotor
    apertureSlits_LIBS += softMotor
    apertureSlits_LIBS += motor
    apertureSlits_LIBS += pmacAsynIPPort
    apertureSlits_LIBS += asyn
    

  4. Use the template files to add records to the database.

    
    # Macros:
    #  P           Device Prefix
    #  M           Device Suffix
    #  PORT        Asyn port for motor record
    #  ADDR        Address on controller
    #  DESC        Description, displayed on EDM screen
    #  MRES        Motor Step Size (EGU)
    #  VELO        Velocity (EGU/s)
    #  PREC        Display Precision
    #  EGU         Engineering Units
    #  DHLM        Dial High Limit
    #  DLLM        Dial Low Limit
    #  TWV         Tweak Step Size (EGU)
    #  DTYP        DTYP of record
    #  DIR         User Direction
    #  VBAS        Base Velocity (EGU/s)
    #  VMAX        Max Velocity (EGU/s), defaults to VELO
    #  ACCL        Seconds to Velocity
    #  BDST        BL Distance (EGU)
    #  BVEL        BL Velocity (EGU/s)
    #  BACC        BL Seconds to Veloc.
    #  HLSV        HW Lim. Violation Svr
    #  INIT        Startup commands
    #  SREV        Steps per Revolution
    #  RRES        Readback Step Size (EGU)
    #  ERES        Encoder Step Size (EGU)
    #  JAR         Jog Acceleration (EGU/s^2)
    #  UEIP        Use Encoder If Present
    #  URIP        Use RDBL If Present
    #  RDBL        Readback Location, set URIP = 1 if you specify this
    #  RTRY        Max retry count
    #  DLY         Readback settle time (s)
    #  OFF         User Offset (EGU)
    #  RDBD        Retry Deadband (EGU)
    #  FOFF        Freeze Offset, 0=variable, 1=frozen
    #  ADEL        Alarm monitor deadband (EGU)
    #  NTM         New Target Monitor, only set to 0 for soft motors
    #  FEHIGH      HIGH limit for following error
    #  FEHIHI      HIHI limit for following error
    #  FEHHSV      HIHI alarm severity for following error
    #  FEHSV       HIGH alarm severity for following error
    #  SCALE       Scale factor, if pmacSetAxisScale is used this should be set
    #  HOMEVIS     If 1 then home is visible on the gui
    #  HOMEVISSTR  If HOMEVIS=0, then display this text on the gui instead
    #  name        Object name and gui association name
    #  alh         Set this to alh to add the motor to the alarm handler and send emails, 
    #  gda_name    Name to export this as to GDA
    #  gda_desc    Description to export this as to GDA
    file $(MOTOR)/db/basic_asyn_motor.template
    {
    pattern { P, M, PORT, ADDR, DESC, MRES, VELO, PREC, EGU, DHLM, DLLM, TWV, DTYP, DIR, VBAS, VMAX, ACCL, BDST, BVEL, BACC, HLSV, INIT, SREV, RRES, ERES, JAR, UEIP, URIP, RDBL, RTRY, DLY, OFF, RDBD, FOFF, ADEL, NTM, FEHIGH, FEHIHI, FEHHSV, FEHSV, SCALE, HOMEVIS, HOMEVISSTR, name, alh, gda_name, gda_desc }
        { "APERTURESLIT", ":XA", "BRICK1", "1", "Aperture A X", "0.001", "1", "3", "mm", "1000", "-1000", "0.1", "asynMotor", "0", "0", "$(VELO)", "0.5", "0", "0", "", "MAJOR", "", "1000", "", "", "", "0", "0", "", "0", "0", "2", "", "0", "0", "1", "0", "0", "NO_ALARM", "NO_ALARM", "1", "1", "Use motor summary screen", "S.XA", "None", "", "$(DESC)" }
        { "APERTURESLIT", ":YA", "BRICK1", "2", "Aperture A Y", "0.001", "1", "3", "mm", "1000", "-1000", "0.1", "asynMotor", "0", "0", "$(VELO)", "0.5", "0", "0", "", "MAJOR", "", "1000", "", "", "", "0", "0", "", "0", "0", "3", "", "0", "0", "1", "0", "0", "NO_ALARM", "NO_ALARM", "1", "1", "Use motor summary screen", "S.YA", "None", "", "$(DESC)" }
        { "APERTURESLIT", ":XB", "BRICK1", "3", "Aperture B X", "0.001", "1", "3", "mm", "1000", "-1000", "0.1", "asynMotor", "0", "0", "$(VELO)", "0.5", "0", "0", "", "MAJOR", "", "1000", "", "", "", "0", "0", "", "0", "0", "0", "", "0", "0", "1", "0", "0", "NO_ALARM", "NO_ALARM", "1", "1", "Use motor summary screen", "S.XB", "None", "", "$(DESC)" }
        { "APERTURESLIT", ":YB", "BRICK1", "4", "Aperture B Y", "0.001", "1", "3", "mm", "1000", "-1000", "0.1", "asynMotor", "0", "0", "$(VELO)", "0.5", "0", "0", "", "MAJOR", "", "1000", "", "", "", "0", "0", "", "0", "0", "0", "", "0", "0", "1", "0", "0", "NO_ALARM", "NO_ALARM", "1", "1", "Use motor summary screen", "S.YB", "None", "", "$(DESC)" }
        { "APERTURESLIT", ":X:CENTRE", "BRICK1CS2", "6", "X Centre (compound)", "0.0001", "1", "3", "mm", "1000", "-1000", "0.1", "asynMotor", "0", "0", "$(VELO)", "0.5", "0", "0", "", "MAJOR", "", "1000", "", "", "", "0", "0", "", "0", "0", "0", "", "0", "0", "1", "0", "0", "NO_ALARM", "NO_ALARM", "1", "1", "Use motor summary screen", "S.XCENTRE", "None", "", "$(DESC)" }
        { "APERTURESLIT", ":X:GAP", "BRICK1CS2", "7", "X Gap (compound)", "0.0001", "1", "3", "mm", "1000", "-1000", "0.1", "asynMotor", "0", "0", "$(VELO)", "0.5", "0", "0", "", "MAJOR", "", "1000", "", "", "", "0", "0", "", "0", "0", "0", "", "0", "0", "1", "0", "0", "NO_ALARM", "NO_ALARM", "1", "1", "Use motor summary screen", "S.XGAP", "None", "", "$(DESC)" }
        { "APERTURESLIT", ":Y:CENTRE", "BRICK1CS3", "6", "Y Centre (compound)", "0.0001", "1", "3", "mm", "1000", "-1000", "0.1", "asynMotor", "0", "0", "$(VELO)", "0.5", "0", "0", "", "MAJOR", "", "1000", "", "", "", "0", "0", "", "0", "0", "0", "", "0", "0", "1", "0", "0", "NO_ALARM", "NO_ALARM", "1", "1", "Use motor summary screen", "S.YCENTRE", "None", "", "$(DESC)" }
        { "APERTURESLIT", ":Y:GAP", "BRICK1CS3", "7", "Y Gap (compound)", "0.0001", "1", "3", "mm", "1000", "-1000", "0.1", "asynMotor", "0", "0", "$(VELO)", "0.5", "0", "0", "", "MAJOR", "", "1000", "", "", "", "0", "0", "", "0", "0", "0", "", "0", "0", "1", "0", "0", "NO_ALARM", "NO_ALARM", "1", "1", "Use motor summary screen", "S.YGAP", "None", "", "$(DESC)" }
    }
    
    # Macros:
    #  P      Template argument
    #  M      Template argument
    #  SPORT  Template argument
    file $(PMACCOORD)/db/motor_in_cs.template
    {
    pattern { P, M, SPORT }
        { "APERTURESLIT", ":XA", "BRICK1port" }
        { "APERTURESLIT", ":YA", "BRICK1port" }
        { "APERTURESLIT", ":XB", "BRICK1port" }
        { "APERTURESLIT", ":YB", "BRICK1port" }
    }
    
    # Macros:
    #  P      Pv Prefix
    #  PORT   Delta tau motor controller comms port
    #  COORD  Co-ordinate system number
    #  APPV   Pv of real AP motor, e.g. $(P):XA
    #  AMPV   Pv of real AM motor, e.g. $(P):XB
    #  PREC   Precision to display variables
    #  name   Object name and gui association name
    file $(PMACCOORD)/db/aperture_slits.template
    {
    pattern { P, PORT, COORD, APPV, AMPV, PREC, name }
        { "APERTURESLIT:X", "BRICK1port", "2", "APERTURESLIT:XA", "APERTURESLIT:XB", "3", "S.XSETUP" }
        { "APERTURESLIT:Y", "BRICK1port", "3", "APERTURESLIT:YA", "APERTURESLIT:YB", "3", "S.YSETUP" }
    }
    

  5. Add the startup commands to st.cmd
    
    # Loading libraries
    # -----------------
    
    # Device initialisation
    # ---------------------
    
    cd "$(TOP)"
    
    dbLoadDatabase "dbd/apertureSlits.dbd"
    apertureSlits_registerRecordDeviceDriver(pdbbase)
    
    # Create IP Port (PortName, IPAddr)
    pmacAsynIPConfigure("BRICK1port", "172.23.243.156:1025")
    
    # Create asyn motor port (AsynPort, Addr, BrickNum, NAxes)
    pmacAsynMotorCreate("BRICK1port", 0, 0, 8)
    # Configure GeoBrick (MotorPort, DriverName, BrickNum, NAxes+1)
    drvAsynMotorConfigure("BRICK1", "pmacAsynMotor", 0, 9)
    pmacSetIdlePollPeriod(0, 500)
    pmacSetMovingPollPeriod(0, 50)
    
    # Configure StreamDevice paths
    epicsEnvSet "STREAM_PROTOCOL_PATH", "$(PMACCOORD)/data"
    
    # Create CS (ControllerPort, Addr, CSNumber, CSRef, Prog)
    pmacAsynCoordCreate("BRICK1port", 0, 2, 0, 10)
    # Configure CS (PortName, DriverName, CSRef, NAxes)
    drvAsynMotorConfigure("BRICK1CS2", "pmacAsynCoord", 0, 9)
    # Set Idle and Moving poll periods (CS_Ref, PeriodMilliSeconds)
    pmacSetCoordIdlePollPeriod(0, 500)
    pmacSetCoordMovingPollPeriod(0, 100)
    
    # Create CS (ControllerPort, Addr, CSNumber, CSRef, Prog)
    pmacAsynCoordCreate("BRICK1port", 0, 3, 1, 10)
    # Configure CS (PortName, DriverName, CSRef, NAxes)
    drvAsynMotorConfigure("BRICK1CS3", "pmacAsynCoord", 1, 9)
    # Set Idle and Moving poll periods (CS_Ref, PeriodMilliSeconds)
    pmacSetCoordIdlePollPeriod(1, 500)
    pmacSetCoordMovingPollPeriod(1, 100)
    
 All Classes Files Functions Variables Typedefs Defines