EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: asynMotor: NewFocus 874x Picomotor Controller Driver
From: Torsten Bögershausen <[email protected]>
To: Angelic Ebbers <[email protected]>, <[email protected]>
Date: Wed, 28 Mar 2018 08:27:35 +0200
Hej Angelic,
I'm pretty sure that the usage of MOT1 is the problem.
You need 2 different asyn ports:
- one to communicate via TCP/IP to the motion controller
- the second to allow the generic model 3 driver (devMotorAsyn)
  to access the C++ classes in asynMotorController.cpp and
  asynMotorAxis.cpp

This is what I use:
#One:
epicsEnvSet("IPADDR",        "127.0.0.1")
epicsEnvSet("IPPORT",        "5000")
epicsEnvSet("ASYN_PORT",     "MC_CPU1")

#two:
epicsEnvSet("MOTOR_PORT",    "MCU1")

#And then for one:
drvAsynIPPortConfigure("MC_CPU1","127.0.0.1:5000",0,0,0)
asynOctetSetOutputEos("MC_CPU1", -1, ";\n")
asynOctetSetInputEos("MC_CPU1", -1, ";\n")

#And for two:
EthercatMCCreateController("MCU1", "MC_CPU1", "32", "200", "1000")

EthercatMCCreateAxis("MCU1", ...)

dbLoadRecords("./db/EthercatMC.template", "PREFIX=IOC:, MOTOR_NAME=m1, R=m1-, MOTOR_PORT=MCU1, AXIS_NO=1, DESC=motor1 ")

# And the template looks similar to this:
record(motor,"$(PREFIX)$(MOTOR_NAME)")
{
	field(DESC,"$(DESC)")
	field(DTYP,"asynMotor")
	field(OUT,"@asyn($(MOTOR_PORT),$(AXIS_NO))")
        [snip]
}


#########
# (end of blabla)
So in your code
 nf874xCreateController("M0", "MOT1", 1, 200, 1000)

"M0" is "MCU1" in my example
"MOT1" is "MC_CPU1" in my example

And with that knowledge you should be able to use "M0" and "MOT1"
in the right way.

On 28/03/18 06:55, Angelic Ebbers wrote:
Hi,

    I'm working on supporting a New Focus 8743-CL controller at Gemini Observatory using EPICS/RTEMS.  I was thrilled to see that there already is a driver for the 8742 model controller in the motor distribution.  From my initial reading, I'm thinking there will be minimal changes needed to support closed loop control.      I've been trying to set up the driver, connected to the 8743, expecting that most functionality is the same as the 8742.  I seem to be doing something wrong, however, since the IOC crashes during/shortly after iocInit .. appearing to encounter problems during init_record.  The errors I'm getting seem to indicate a problem with how I'm setting up the driver support.  I'm following the example in "iocBoot/iocNewFocus874x".

      Here are the errors I'm getting:

    lis:m1Offset devAsynFloat64::initCommon findInterface asynFloat64Type
    Bad init_rec return value  PV: lis:m1Offset ao: init_record

    lis:m1Resolution devAsynFloat64::initCommon findInterface asynFloat64Type
    Bad init_rec return value  PV: lis:m1Resolution ao: init_record

    lis:m1Direction devAsynInt32::initCommon findInterface asynInt32Type
    2018/03/27 17:09:45.730 devMotorAsyn::init_record, lis:m1 find int32
    interface failed


     I've done some digging on "devMotorAsyn::init_record find int32 interface failed" and found several TechTalk threads about trying to set up model 1 drivers as model 3 (using asyn).  The specific problem in those cases was specifying DTYP as "asynMotor". (link to thread: https://epics.anl.gov/tech-talk/2013/msg02425.php <https://epics.anl.gov/tech-talk/2013/msg02425.php>)       I'm pretty sure I'm setting up the driver with the correct approach though and find no other clues as to the root of the problem.

Here is my motor substitution file:

    file "db/basic_asyn_motor.db"
    {
    pattern
    {P,N,M,DTYP,PORT,ADDR,C,S,DESC,EGU,DIR,VELO,VBAS,ACCL,BDST,BVEL,BACC,MRES,PREC,DHLM,DLLM,INIT}
    {lis:,1,   "m$(N)","asynMotor",MOT1,1,0,0,"Rot",
    counts,Pos,1750,500,1,0,0,50,1,0,0,0,""}
    }


relevant portion of my startup script:

    ### Motors
    # Setup IP port for 8742
    drvAsynIPPortConfigure("MOT1", "10.1.60.111:23 <http://10.1.60.111:23/>")
    asynOctetSetInputEos("MOT1",0,"\r\n")
    asynOctetSetOutputEos("MOT1",0,"\r")

    #db asyn debug traces
    asynSetTraceMask("MOT1",0,0x9)
    asynSetTraceIOMask("MOT1",0,0x2)

    nf874xCreateController("M0", "MOT1", 1, 200, 1000)

    ## Load record instances
    dbLoadTemplate("data/newfocus8742.asyn.motor.substitutions")

    dbLoadRecords("${ASYN}/db/asynRecord.db",
    "P="lis:",R=Asyn,PORT=MOT1,ADDR=,OMAX=80,IMAX=80")



I've done a bunch of checking to ensure that my dbd has all of the asyn/motor support built in .. It seems ok.
Here's the Makefile component:

    gis-mk-ioc_DBD += motorSupport.dbd
    gis-mk-ioc_DBD += devNewFocus.dbd
    gis-mk-ioc_DBD += devSoftMotor.dbd
    gis-mk-ioc_DBD += motorSimSupport.dbd
    gis-mk-ioc_DBD += asyn.dbd
    gis-mk-ioc_DBD += drvAsynSerialPort.dbd
    gis-mk-ioc_DBD += drvAsynIPPort.dbd

    gis-mk-ioc_LIBS += NewFocus
    gis-mk-ioc_LIBS += softMotor
    gis-mk-ioc_LIBS += motorSimSupport
    gis-mk-ioc_LIBS += motor
    gis-mk-ioc_LIBS += asyn



Cheers,
Angelic Ebbers



Replies:
Re: asynMotor: NewFocus 874x Picomotor Controller Driver Mark Rivers
References:
asynMotor: NewFocus 874x Picomotor Controller Driver Angelic Ebbers

Navigate by Date:
Prev: asynMotor: NewFocus 874x Picomotor Controller Driver Angelic Ebbers
Next: RE: StreamDevice with Telnet port Abdalla Ahmad
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: asynMotor: NewFocus 874x Picomotor Controller Driver Angelic Ebbers
Next: Re: asynMotor: NewFocus 874x Picomotor Controller Driver Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020  2021  2022  2023  2024 
ANJ, 28 Mar 2018 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·