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  2022  2023  <20242025  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  <20242025 
<== Date ==> <== Thread ==>

Subject: AW: asyn port locking while motorIMS controller limit-switch configuration is read
From: "Eckert, Sebastian via Tech-talk" <tech-talk at aps.anl.gov>
To: Mark Rivers <rivers at cars.uchicago.edu>, "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Mon, 28 Oct 2024 10:47:05 +0000

Hi Mark,


if I use pasynManager->lockPort(pAsynUserIMS) the boot is stuck at the call in line 211:


status = this->writeReadController(cmd, resp, sizeof(resp), &nread, IMS_TIMEOUT);


and therein in line 362:

status = pasynOctetSyncIO->writeRead(pAsynUserIMS, outbuff, strlen(outbuff), input, maxChars, timeout, &nwrite, nread, &eomReason);


Can it be that we interfere with the queueLockPort in the asyn writeRead function?


Best

Sebastian



Von: Mark Rivers <rivers at cars.uchicago.edu>
Gesendet: Mittwoch, 23. Oktober 2024 19:31:16
An: Eckert, Sebastian; tech-talk at aps.anl.gov
Betreff: RE: asyn port locking while motorIMS controller limit-switch configuration is read
 

I was mistaken, I just looked at the driver and pasynUserIMS is the correct asynUser.  This is where it is connected to the underlying IOPortName driver.

 

https://github.com/epics-motor/motorIms/blob/f1abd73f1971810c16b580c1f0e328ccb656badf/imsApp/src/ImsMDrivePlusMotorController.cpp#L68

 

  • Using pasynManager->lockPort(pAsynUserIMS) prevents any further controller configuration and the IOC hangs at the boot process.

 

Once you lock the port you probably cannot used the SyncIO functions, you need to use the non-SyncIO versions.  You should put printf statements for each line after you lock the port and see where it is hanging.

 

Mark

 

 

From: Eckert, Sebastian <sebastian.eckert at helmholtz-berlin.de>
Sent: Wednesday, October 23, 2024 11:52 AM
To: Mark Rivers <rivers at cars.uchicago.edu>; tech-talk at aps.anl.gov
Subject: AW: asyn port locking while motorIMS controller limit-switch configuration is read

 

Hi Mark,

 

would this be pasynUserSelf or how do I pass the correct user?

 

Best,

Sebastian


Von: Mark Rivers <rivers at cars.uchicago.edu>
Gesendet: Mittwoch, 23. Oktober 2024 18:20:57
An: Eckert, Sebastian; tech-talk at aps.anl.gov
Betreff: RE: asyn port locking while motorIMS controller limit-switch configuration is read

 

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>
Sent: Wednesday, October 23, 2024 11:16 AM
To: Mark Rivers <rivers at cars.uchicago.edu>; tech-talk at aps.anl.gov
Subject: AW: asyn port locking while motorIMS controller limit-switch configuration is read

 

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>
Gesendet: Mittwoch, 23. Oktober 2024 18:00:54
An: Eckert, Sebastian; tech-talk at aps.anl.gov
Betreff: RE: asyn port locking while motorIMS controller limit-switch configuration is read

 

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
Sent: Wednesday, October 23, 2024 10:50 AM
To: tech-talk at aps.anl.gov
Subject: asyn port locking while motorIMS controller limit-switch configuration is read

 

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

 



Helmholtz-Zentrum Berlin für Materialien und Energie GmbH

Mitglied der Hermann von Helmholtz-Gemeinschaft Deutscher Forschungszentren e.V.

Aufsichtsrat: Vorsitzender Dr. Volkmar Dietz, stv. Vorsitzende Dr. Jutta Koch-Unterseher
Geschäftsführung: Prof. Dr. Bernd Rech, Thomas Frederking

Sitz Berlin, AG Charlottenburg, 89 HRB 5583

Postadresse:
Hahn-Meitner-Platz 1
14109 Berlin
Deutschland

Diese E-Mail kann vertrauliche und/oder rechtlich geschützte Informationen enthalten. Wenn Sie diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den*die Absender*in und vernichten Sie diese Mail. Das unerlaubte Kopieren, die Veröffentlichung sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.
This email may contain confidential and/or proprietary information. If you have received this e-mail in error, please inform the sender immediately and destroy this e-mail. Unauthorized copying, publishing or distribution of this e-mail is not permitted.

 



Helmholtz-Zentrum Berlin für Materialien und Energie GmbH

Mitglied der Hermann von Helmholtz-Gemeinschaft Deutscher Forschungszentren e.V.

Aufsichtsrat: Vorsitzender Dr. Volkmar Dietz, stv. Vorsitzende Dr. Jutta Koch-Unterseher
Geschäftsführung: Prof. Dr. Bernd Rech, Thomas Frederking

Sitz Berlin, AG Charlottenburg, 89 HRB 5583

Postadresse:
Hahn-Meitner-Platz 1
14109 Berlin
Deutschland

Diese E-Mail kann vertrauliche und/oder rechtlich geschützte Informationen enthalten. Wenn Sie diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den*die Absender*in und vernichten Sie diese Mail. Das unerlaubte Kopieren, die Veröffentlichung sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.
This email may contain confidential and/or proprietary information. If you have received this e-mail in error, please inform the sender immediately and destroy this e-mail. Unauthorized copying, publishing or distribution of this e-mail is not permitted.

 



Helmholtz-Zentrum Berlin für Materialien und Energie GmbH

Mitglied der Hermann von Helmholtz-Gemeinschaft Deutscher Forschungszentren e.V.

Aufsichtsrat: Vorsitzender Dr. Volkmar Dietz, stv. Vorsitzende Dr. Jutta Koch-Unterseher
Geschäftsführung: Prof. Dr. Bernd Rech, Thomas Frederking

Sitz Berlin, AG Charlottenburg, 89 HRB 5583

Postadresse:
Hahn-Meitner-Platz 1
14109 Berlin
Deutschland

Diese E-Mail kann vertrauliche und/oder rechtlich geschützte Informationen enthalten. Wenn Sie diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den*die Absender*in und vernichten Sie diese Mail. Das unerlaubte Kopieren, die Veröffentlichung sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.
This email may contain confidential and/or proprietary information. If you have received this e-mail in error, please inform the sender immediately and destroy this e-mail. Unauthorized copying, publishing or distribution of this e-mail is not permitted.




Helmholtz-Zentrum Berlin für Materialien und Energie GmbH

Mitglied der Hermann von Helmholtz-Gemeinschaft Deutscher Forschungszentren e.V.

Aufsichtsrat: Vorsitzender Dr. Volkmar Dietz, stv. Vorsitzende Dr. Jutta Koch-Unterseher
Geschäftsführung: Prof. Dr. Bernd Rech, Thomas Frederking

Sitz Berlin, AG Charlottenburg, 89 HRB 5583

Postadresse:
Hahn-Meitner-Platz 1
14109 Berlin
Deutschland

Diese E-Mail kann vertrauliche und/oder rechtlich geschützte Informationen enthalten. Wenn Sie diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den*die Absender*in und vernichten Sie diese Mail. Das unerlaubte Kopieren, die Veröffentlichung sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.
This email may contain confidential and/or proprietary information. If you have received this e-mail in error, please inform the sender immediately and destroy this e-mail. Unauthorized copying, publishing or distribution of this e-mail is not permitted.

Replies:
Re: asyn port locking while motorIMS controller limit-switch configuration is read Mark Rivers via Tech-talk
References:
asyn port locking while motorIMS controller limit-switch configuration is read Eckert, Sebastian via Tech-talk
RE: asyn port locking while motorIMS controller limit-switch configuration is read Mark Rivers via Tech-talk
AW: asyn port locking while motorIMS controller limit-switch configuration is read Eckert, Sebastian via Tech-talk
RE: asyn port locking while motorIMS controller limit-switch configuration is read Mark Rivers via Tech-talk
AW: asyn port locking while motorIMS controller limit-switch configuration is read Eckert, Sebastian via Tech-talk
RE: asyn port locking while motorIMS controller limit-switch configuration is read Mark Rivers via Tech-talk

Navigate by Date:
Prev: Review of submission for new QuadEM Iain Marcuson via Tech-talk
Next: Re: asyn port locking while motorIMS controller limit-switch configuration is read Mark Rivers 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  2022  2023  <20242025 
Navigate by Thread:
Prev: RE: asyn port locking while motorIMS controller limit-switch configuration is read Mark Rivers via Tech-talk
Next: Re: asyn port locking while motorIMS controller limit-switch configuration is read Mark Rivers 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  2022  2023  <20242025 
ANJ, 28 Oct 2024 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions ·
· Download · Search · IRMIS · Talk · Documents · Links · Licensing ·