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 2022 2023 <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 2022 2023 <2024> 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | RE: asyn port locking while motorIMS controller limit-switch configuration is read |
From: | Mark Rivers via Tech-talk <tech-talk at aps.anl.gov> |
To: | "Eckert, Sebastian" <sebastian.eckert at helmholtz-berlin.de>, "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov> |
Date: | Wed, 23 Oct 2024 16:20:57 +0000 |
Hi Sebastian, You are using the wrong pasynUser. You need to use the pasynUser that is connected to the RS-485 asyn port driver, not to the IMS port driver. Mark From: Eckert, Sebastian <sebastian.eckert at helmholtz-berlin.de>
Hi Mark,
Thanks for the help! Using pasynManager->lockPort(pAsynUserIMS) prevents any further controller configuration and the IOC hangs at the boot process. Using pasynManager->queueLockPort(pAsynUserIMS) I get the following error: ims: pthread_mutex_lock.c:423: __pthread_mutex_lock_full: Assertion `e != EDEADLK || (kind != PTHREAD_MUTEX_ERRORCHECK_NP && kind != PTHREAD_MUTEX_RECURSIVE_NP)' failed. Best, Sebastian Von: Mark Rivers <rivers at cars.uchicago.edu> Hi Sebastian, You need to lock the underlying RS-485 driver, not the IMS motor driver. You can call pasynManager->lockPort() or pasynManager->queueLockPort() Mark From: Tech-talk <tech-talk-bounces at aps.anl.gov>
On Behalf Of Eckert, Sebastian via Tech-talk Dear asyn and motor-record experts, I have trouble with the lines 208 to 213 in the following file of the motorIMS driver: https://github.com/epics-motor/motorIms/blob/master/imsApp/src/ImsMDrivePlusMotorController.cpp#L208 pasynOctetSyncIO->setInputEos(pAsynUserIMS, "\0", 1); sprintf(cmd, "PR IS"); resp[0] = 0; status = this->writeReadController(cmd, resp, sizeof(resp), &nread, IMS_TIMEOUT); printf("%s\n", resp); pasynOctetSyncIO->setInputEos(pAsynUserIMS, "\n", 1); There the inputEOS is changed, because the controller's response to the "PR IS" contains information on the limit-switch configuration in multiple lines each teminated with \n. If one doesn't change
the EOS, only the configuration of the first analog input is read and info on the others is lost. This works fine as long as there is just one motor controller on the RS-485 line. When multiple controllers are used, the change of the eos for the controller which is created interferes with the
poll-routines of the other motors, which are already set-up. I tried to lock the port during this step of the configuration with this->lock() before and this->unlock() after the mentioned lines of code, but it had no effect. Is there a way to lock the port,
or to pause the polling of the other controllers while the mentioned lines are executed. Thanks a lot in advance! Sebastian
|