Build Instructions for CS2jack
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
Add the DBD dependencies to src/Makefile
CS2jack_DBD += base.dbd CS2jack_DBD += asyn.dbd CS2jack_DBD += pmacAsynIPPort.dbd CS2jack_DBD += motorSupport.dbd CS2jack_DBD += devSoftMotor.dbd CS2jack_DBD += pmacAsynMotor.dbd CS2jack_DBD += stream.dbd CS2jack_DBD += pmacAsynCoord.dbd
Add the LIBS dependencies to src/Makefile
CS2jack_LIBS += pmacAsynCoord CS2jack_LIBS += stream CS2jack_LIBS += pcre CS2jack_LIBS += pmacAsynMotor CS2jack_LIBS += softMotor CS2jack_LIBS += motor CS2jack_LIBS += pmacAsynIPPort CS2jack_LIBS += asyn
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 } { "2JACK", ":J1", "BRICK1", "1", "Jack 1", "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", "M1.J1", "None", "", "$(DESC)" } { "2JACK", ":J2", "BRICK1", "2", "Jack 2", "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", "M1.J2", "None", "", "$(DESC)" } { "2JACK", ":Y", "BRICK1CS2", "6", "Y (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", "M1.Y", "None", "", "$(DESC)" } { "2JACK", ":PITCH", "BRICK1CS2", "7", "Pitch (compound)", "0.0001", "1", "3", "rad", "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", "M1.PITCH", "None", "", "$(DESC)" } } # Macros: # P Template argument # M Template argument # SPORT Template argument file $(PMACCOORD)/db/motor_in_cs.template { pattern { P, M, SPORT } { "2JACK", ":J1", "BRICK1port" } { "2JACK", ":J2", "BRICK1port" } } # Macros: # P Pv Prefix # PORT Delta tau motor controller comms port # COORD Co-ordinate system number # PREC Precision to display variables # J1PV Pv of real Jack1 motor, e.g. $(P):J1 # J2PV Pv of real Jack1 motor, e.g. $(P):J2 # name Object name and gui association name file $(PMACCOORD)/db/2jack.template { pattern { P, PORT, COORD, PREC, J1PV, J2PV, name } { "2JACK", "BRICK1port", "2", "3", "$(P):J1", "$(P):J2", "M1.SETUP" } }
# Loading libraries # ----------------- # Device initialisation # --------------------- cd "$(TOP)" dbLoadDatabase "dbd/CS2jack.dbd" CS2jack_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)