diff --git a/iocBoot/iocWithAsyn/motor.substitutions.AG_CONEX b/iocBoot/iocWithAsyn/motor.substitutions.AG_CONEX new file mode 100644 index 00000000..aa6098b8 --- /dev/null +++ b/iocBoot/iocWithAsyn/motor.substitutions.AG_CONEX @@ -0,0 +1,7 @@ +file "$(TOP)/db/basic_asyn_motor.db" +{ +pattern +{P, N, M, DTYP, PORT, ADDR, DESC, EGU, DIR, VELO, VBAS, ACCL, BDST, BVEL, BACC, MRES, PREC, DHLM, DLLM, INIT} +{IOC:, 1, "m$(N)", "asynMotor", Agilis1, 0, "Horizontal", mm, Pos, .5, 0.1, .25, 0, 1, .2, .001, 3, 3, -3, ""} +{IOC:, 2, "m$(N)", "asynMotor", Agilis1, 1, "Vertical", mm, Pos, .5, 0.1, .25, 0, 1, .2, .001, 3, 3, -3, ""} +} diff --git a/iocBoot/iocWithAsyn/st.cmd.AG_CONEX b/iocBoot/iocWithAsyn/st.cmd.AG_CONEX new file mode 100644 index 00000000..85ce51e9 --- /dev/null +++ b/iocBoot/iocWithAsyn/st.cmd.AG_CONEX @@ -0,0 +1,40 @@ +#errlogInit(5000) +< envPaths +# Tell EPICS all about the record types, device-support modules, drivers, +# etc. +dbLoadDatabase("../../dbd/WithAsyn.dbd") +WithAsyn_registerRecordDeviceDriver(pdbbase) + +### Motors +dbLoadTemplate "motor.substitutions.AG_CONEX" + +# For Windows +#drvAsynSerialPortConfigure("serial1", "COM3", 0, 0, 0) +# For Linux +drvAsynSerialPortConfigure("serial1", "/dev/ttyUSB0", 0, 0, 0) +asynOctetSetInputEos("serial1",0,"\r\n") +asynOctetSetOutputEos("serial1",0,"\r\n") +asynSetOption("serial1",0,"baud","921600") +asynSetOption("serial1",0,"bits","8") +asynSetOption("serial1",0,"stop","1") +asynSetOption("serial1",0,"parity","none") +asynSetOption("serial1",0,"clocal","Y") +asynSetOption("serial1",0,"crtscts","N") + +asynSetTraceIOMask("serial1", 0, 2) +#asynSetTraceMask("serial1", 0, 9) + +# Load asynRecord records +dbLoadRecords("$(ASYN)/db/asynRecord.db", "P=IOC:,R=serial1,PORT=serial1, ADDR=0,OMAX=256,IMAX=256") + +# AG_CONEXCreateController(asyn port, serial port, number of axes, +# active poll period (ms), idle poll period (ms)) +AG_CONEXCreateController("Agilis1", "serial1", 2, 50, 500) +asynSetTraceIOMask("Agilis1", 0, 2) +#asynSetTraceMask("Agilis1", 0, 255) + +# AC_CONEXCreateAxis((AG_CONEX controller port, axis, hasLimits, forwardAmplitude, reverseAmplitude) +AG_CONEXCreateAxis("Agilis1", 0, 0, 50, -30) +AG_CONEXCreateAxis("Agilis1", 1, 0, 40, -50) + +iocInit