From 10ca839b25ce2935625bacbdb21948cd08350ab1 Mon Sep 17 00:00:00 2001 From: MarkRivers Date: Wed, 12 Sep 2012 17:17:24 +0000 Subject: [PATCH] New file from Nia Fong at SLAC --- motorApp/ImsSrc/README.ImsMDrivePlusMotor | 120 ++++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 motorApp/ImsSrc/README.ImsMDrivePlusMotor diff --git a/motorApp/ImsSrc/README.ImsMDrivePlusMotor b/motorApp/ImsSrc/README.ImsMDrivePlusMotor new file mode 100644 index 00000000..372fe929 --- /dev/null +++ b/motorApp/ImsSrc/README.ImsMDrivePlusMotor @@ -0,0 +1,120 @@ +======================================= +ImsMDrivePlusMotor AsynPortDriver Notes + +Author: Nia Fong, SLAC National Laboratory + +First Initial: 10/28/2011 + +This driver is based on "model 3" motor asyn port driver defined by Mark Rivers. +The driver assumes: + 1) each controller is configured for a single axis + 2) the motor is set up for Party Mode (PY=1) and Echo Mode 2 (EM=2) +======================================= + +======================= +Building an Application +======================= +Building the driver into an application requires + +1) The 'asyn', 'motor' and 'ImsMDrivePlusMotor' (this driver) packages/modules to be built and + installed. The application's RELEASE file must point to these packages so that the build process + locates headers and libraries etc. + +2) The application's '.dbd' file must contain + - motorSupport.dbd + - drvAsynIPPort.dbd (or equivalent 'asyn' port driver package) + - devImsMotor.dbd (this include support for all Ims drivers) + + These '.dbd' files are best listed in the application src/Makefile: + _DBD += motorSupport.dbd + _DBD += devImsMotor.dbd + _DBD += drvAsynIPPort.dbd + +3) The application must be linked against the 'Ims', 'motor' and 'asyn' + libraries, e.g., + + _LIBS += Ims motor asyn + +=============== +Custom Database +=============== +There is an IMS specific IMS_extra.db database that contains IMS-specific records. + +IMS_S: saves user variables and flags to controller's NVM + +record(bo,"$(DEV):$(AREA):$(LOC):IMS_S") { + field(DESC, "Ims Save to NVM") + field(PINI, "NO") + field(DTYP, "asynInt32") + field(OUT, "@asyn($(PORT),$(ADDR),$(TIMEOUT))IMS_SAVETONVM") + field(VAL, "0") + field(ZNAM, "No") + field(ONAM, "Yes") +} + +============================= +Driver Run-Time Configuration +============================= +To configure the motor from the iocsh or a C/C++ application + +1) Create and configure an asyn IP port + + drvAsynIPPortConfigure(IOPortName, port, priority, disable auto-connect, no process EOS) + motorPortName: name string assigned to the asyn IP port being created + port: host:port [protocol] + +2) Create and configure an ImsMDrivePlus controller + + ImsMDrivePlusCreateController(motorPortName, IOPortName, devName, movingPollPeriod, idlePollPeriod) + motorPortName: name string assigned to the controller + IOPortName: name of asyn IO port that was created by drvAsynIPPortConfigure() + devName: unique device name used to address the motor in MCode + NOTE: the device name is prepended to all MCode commands to communicate in Party Mode. + See README file for more information. + movingPollPeriod: time in milliseconds between polls when axis is moving + idlePollPeriod: time in milliseconds between polls when axis is not moving + +========================= +Example iocsh st.cmd file +========================= +#!../../bin/linux-x86/ImsMDrivePlus + +# Register all support components +dbLoadDatabase("dbd/ImsMDrivePlus.dbd") +ImsMDrivePlus_registerRecordDeviceDriver pdbbase + +# Motors substitutions, customize this for your motor +dbLoadTemplate "db/motor.mdriveplus.substitutions" + +# Configure asyn communication port, first +drvAsynIPPortConfigure("M06", "ts-b34-nw08:2101", 0, 0, 0 ) + +# Configure one controller per motor, each controller just has 1 axis +ImsMDrivePlusCreateController("IMS1", "M06", "1", 200, 5000) + +# Optional: Enable tracing +asynSetTraceIOMask("IMS1",0,2) +asynSetTraceMask("IMS1",0,2) + +============================================= +Example application database substitions file +============================================= +Db/motor.mdrive.substitutions file: + +file "$(MOTOR)/db/basic_asyn_motor.db" +{ +pattern +{P, N, M, DTYP, PORT, DESC, ADDR, EGU, DIR, VELO, VBAS, ACCL, BDST, BVEL, BACC, DHLM, DLLM, MRES, PREC, INIT} +{IMS:, 1, 1, "asynMotor", IMS1, "MDrive23", 0, mm, Pos, 3.0, 0.017, 2.0, 0, 0.017, 2.0, 100, -100, 0.000083, 4, ""} +} + +file "$(MOTOR)/db/IMS_extra.db" +{ +pattern +{DEV, AREA, LOC, PORT, ADDR, TIMEOUT} +{ims, IOC, 1, IMS1, 0, 1} + + + + +