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  <20192020  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  2018  <20192020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: drvAsynIPPortConfigure and I/O Intr with asynRecord possible?
From: Mark Rivers via Tech-talk <[email protected]>
To: Mark Rivers <[email protected]>, 'Benjamin Franksen' <[email protected]>
Cc: "'[email protected]'" <[email protected]>
Date: Mon, 8 Apr 2019 16:14:47 +0000
Hi Ben,

Please ignore my previous post.  I just tried adding a call to pasynManager->registerInterruptUser to drvAsynIPPort.c, and I get the same error you do:
*************************
diff --git a/asyn/drvAsynSerial/drvAsynIPPort.c b/asyn/drvAsynSerial/drvAsynIPPort.c
index 12c0205..2f85616 100644
--- a/asyn/drvAsynSerial/drvAsynIPPort.c
+++ b/asyn/drvAsynSerial/drvAsynIPPort.c
@@ -1031,7 +1031,14 @@ drvAsynIPPortConfigure(const char *portName,
         ttyCleanup(tty);
         return -1;
     }
-
+void *octetCallbackPvt;
+status = pasynManager->registerInterruptSource(tty->portName, &tty->octet,
+            &octetCallbackPvt);
+if (status != asynSuccess) {
+        printf("drvAsynIPortConfigure registerInterruptSource failed\n");
+        ttyCleanup(tty);
+        return -1;
+}
     /*
      * Register for socket cleanup
      */
*************************
drvAsynIPPortConfigure("IPPort", "newport-xps12:5001", 0, 0, 1);
IPPort asynManager:registerInterruptSource already registered
drvAsynIPortConfigure registerInterruptSource failed

I need to figure this out.  I don't know what code is calling registerInterruptUser for that interface, but it should not be standardInterfacesBase.c.

Mark



-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Mark Rivers via Tech-talk
Sent: Monday, April 8, 2019 10:58 AM
To: 'Benjamin Franksen' <[email protected]>
Cc: '[email protected]' <[email protected]>
Subject: RE: drvAsynIPPortConfigure and I/O Intr with asynRecord possible?

> It is easy to add this capability to drvAsynIPPort. But when I call
> pasynManager->registerInterruptSource I get an error
> "asynManager:registerInterruptSource already registered". 

Where are you calling that from?  How did you call it?

> Apparently there is a mechanism in place that generically registers an 
> interrupt source for /every/ asynOctet interface (and all other 
> standard asyn interfaces, too). This effectively blocks this feature 
> for all standard asyn interfaces, so it becomes impossible to add I/O 
> Intr support to drvAsynIPPort. The code that calls 
> registerInterruptSource in this  generic manner is guarded by an "if 
> (octetCanInterrupt)" but I was unable to find out what I should do for this flag to be reset.

> It gets set by the constructor for class asynPortDriver, but I found 
> no place where this class actually gets instantiated to an object, 
> i.e. a call to the constructor takes place. I find all this pretty confusing and would appreciate hints...

The code that guards with "if (octetCanInterrupt)" is in asynStandardInterfacesBase.c.  That is typically called in the constructor of asynPortDriver.  In the asynPortDriver constructor you pass it a bit mask of interfaces on which your driver will register interrupts.  If you set the asynOctetMask bit in that mask then asynStandardInterfacesBase will call registerInterruptSource on the asynOctet interface.

However, this should be completely irrelevant for the drvAsynIPPort driver, because it does not derive from asynPortDriver and does not use asynStandardInterfacesBase.

Are you sure you were calling pasynManager->registerInterruptSource with a drvAsynIPPort name, and not some other port that derived from asynPortDriver?

Mark



-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Benjamin Franksen via Tech-talk
Sent: Monday, April 8, 2019 9:51 AM
Cc: [email protected]
Subject: Re: drvAsynIPPortConfigure and I/O Intr with asynRecord possible?

Am 04.04.19 um 20:32 schrieb Mark Rivers via Tech-talk:
> The asyn record does NOT work with SCAN=I/O Intr for TCP devices. The 
> problem is that drvAsynIPPort does not have a mechanism to do 
> callbacks when there is new data, so asyn client needs to poll.  The 
> only code I know of that does this is StreamDevice.
It is easy to add this capability to drvAsynIPPort. But when I call
pasynManager->registerInterruptSource I get an error
"asynManager:registerInterruptSource already registered". Apparently there is a mechanism in place that generically registers an interrupt source for /every/ asynOctet interface (and all other standard asyn interfaces, too). This effectively blocks this feature for all standard asyn interfaces, so it becomes impossible to add I/O Intr support to drvAsynIPPort. The code that calls registerInterruptSource in this generic manner is guarded by an "if (octetCanInterrupt)" but I was unable to find out what I should do for this flag to be reset. It gets set by the constructor for class asynPortDriver, but I found no place where this class actually gets instantiated to an object, i.e. a call to the constructor takes place. I find all this pretty confusing and would appreciate hints...

Cheers
Ben


Replies:
RE: drvAsynIPPortConfigure and I/O Intr with asynRecord possible? Mark Rivers via Tech-talk
References:
drvAsynIPPortConfigure and I/O Intr with asynRecord possible? Christoph Schroeder via Tech-talk
Re: drvAsynIPPortConfigure and I/O Intr with asynRecord possible? Mark Rivers via Tech-talk
RE: drvAsynIPPortConfigure and I/O Intr with asynRecord possible? Mark Rivers via Tech-talk
Re: drvAsynIPPortConfigure and I/O Intr with asynRecord possible? Benjamin Franksen via Tech-talk
RE: drvAsynIPPortConfigure and I/O Intr with asynRecord possible? Mark Rivers via Tech-talk

Navigate by Date:
Prev: RE: drvAsynIPPortConfigure and I/O Intr with asynRecord possible? Mark Rivers via Tech-talk
Next: RE: drvAsynIPPortConfigure and I/O Intr with asynRecord possible? 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  <20192020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: drvAsynIPPortConfigure and I/O Intr with asynRecord possible? Mark Rivers via Tech-talk
Next: RE: drvAsynIPPortConfigure and I/O Intr with asynRecord possible? 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  <20192020  2021  2022  2023  2024 
ANJ, 08 Apr 2019 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·