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  2018  2019  2020  2021  <20222023  2024  2025  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  2018  2019  2020  2021  <20222023  2024  2025 
<== Date ==> <== Thread ==>

Subject: RE: motor driver only works with asyn traces turned on
From: Mark Rivers via Tech-talk <tech-talk at aps.anl.gov>
To: "Sintschuk, Michael" <michael.sintschuk at bam.de>
Cc: tech-talk <tech-talk at aps.anl.gov>
Date: Thu, 14 Jul 2022 17:22:20 +0000

Hi Michael,

 

Ø  BUT, it only works when asyn traces are turned on at IOC startup:

 

That indicates the problem is a timing issue.  When you enable asynTrace you slow down the execution of the program a little bit, which eliminates the timing problem.

 

My first guess would be that your controller is not able to accept commands quite as fast as they are sent when you disable asynTrace.

 

Here are the things I would suggest.

 

Add this line to you startup script after line 20:

 

asynSetTraceFile("serial1",0,"PS10.txt")

 

That will put the asynTrace output into the file PS10.txt.  If you are lucky writing the file will be faster than sending the trace output to the console, and the driver will not work.  That might let you see where the communication is messing up.

 

Another suggestion would be to override the asynMotorController::writeReadController method in your PS10Controller class, but add an epicsThreadSleep() after calling pasynOctetSyncIO->writeRead.  That might fix the problem.  Here is an example:

 

/** Writes a string to the controller and reads a response.

  * \param[in] output Pointer to the output string.

  * \param[out] input Pointer to the input string location.

  * \param[in] maxChars Size of the input buffer.

  * \param[out] nread Number of characters read.

  * \param[out] timeout Timeout before returning an error.*/

asynStatus PS10Controller::writeReadController(const char *output, char *input,

                                                    size_t maxChars, size_t *nread, double timeout)

{

  size_t nwrite;

  asynStatus status;

  int eomReason;

  // const char *functionName="writeReadController";

 

  status = pasynOctetSyncIO->writeRead(pasynUserController_, output,

                                       strlen(output), input, maxChars, timeout,

                                       &nwrite, nread, &eomReason);

  epicsThreadSleep(0.05);

                       

  return status;

}

 

Mark

 

From: Tech-talk <tech-talk-bounces at aps.anl.gov> On Behalf Of Sintschuk, Michael via Tech-talk
Sent: Thursday, July 14, 2022 9:56 AM
To: tech-talk at aps.anl.gov
Subject: motor driver only works with asyn traces turned on

 

Hi EPICS-community,

 

I’m trying to write a model 3 motor driver for ps 10 controller from OWIS. So far I made some good progress and I can move/stop the connected rotation stage (stepper motor, no encoder), also setting the velocity and running a homing sequence is possible.

BUT, it only works when asyn traces are turned on at IOC startup:

 

asynSetTraceIOMask("serial1",0,0x1)

asynSetTraceMask("serial1",0,0x3)

 

If I comment them out, the move command doesn’t work after IOC start. The Retry counts count until 11 and that’s it. The only thing that works is the homing sequence.

Did someone experienced such a behavior before? Do I have some obvious mistake somewhere in the driver-code?

I uploaded the code to git: https://github.com/MichaS-git/motorOwis

 

Regards

Michael


Replies:
AW: motor driver only works with asyn traces turned on Sintschuk, Michael via Tech-talk
References:
motor driver only works with asyn traces turned on Sintschuk, Michael via Tech-talk

Navigate by Date:
Prev: motor driver only works with asyn traces turned on Sintschuk, Michael via Tech-talk
Next: Re: [EXTERNAL] Phoebus Alarm Area Panel custom colours Maren Purves via Tech-talk
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  2018  2019  2020  2021  <20222023  2024  2025 
Navigate by Thread:
Prev: motor driver only works with asyn traces turned on Sintschuk, Michael via Tech-talk
Next: AW: motor driver only works with asyn traces turned on Sintschuk, Michael via Tech-talk
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  2018  2019  2020  2021  <20222023  2024  2025 
ANJ, 14 Sep 2022 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions ·
· Download · Search · IRMIS · Talk · Documents · Links · Licensing ·