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  <20132014  2015  2016  2017  2018  2019  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  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: [asyn] link already open!
From: Dirk Zimoch <[email protected]>
To: [email protected]
Date: Mon, 12 Aug 2013 09:06:01 +0200
On 09.08.2013 17:05, Pavel Maslov wrote:
Mark, I cannot do anything to StreamDevice records - I mean I can caget
and caput, but everytime they get processed - those error messages pop
up. And the PVs are invalid all the time never change values. This said,
I can talk to my Java Simulator using asynrecord:
dbpf lambda1-ps:asyn.AOUT "*idn?"
, and I get the response. No problem. So it's StreamDevice that produces
these errors (as you pointed out). Also, I don't think that my Java
Simulator is slow. I tried your solution to lengthen the auto connect
time but the problem still remains.

What I am confident in, though, (sorry for not telling this before) is
that it has to do with the fact that I am loading asyn+streamdevice
support module dynamically (from iocsh).
When I use it the normal EPICS way - everything is fine as it should be.


I do the same and that works for me. But you have to be careful: Are you sure that you load the same version of asyn that you used to compile StreamDevice?

Sometimes the binary API of asyn changes from one version to another (although the source API is the same). That happens when functions pointers in the function tables get re-ordered in a new asyn version.

Dirk





--
Regards,


Pavel Maslov, MS


On Fri, Aug 9, 2013 at 4:14 PM, Mark Rivers <[email protected]
<mailto:[email protected]>> wrote:

    You have created the port with autoconnect disabled.  Thus, I expect
    the error message that says that queueRequest failed, because the
    port is not connected.  But then asynReport says that the port is
    connected.  This must be because StreamDevice connected it?  But
    once it is connected then your StreamDevice records should work
    correctly.  Do they?  If you force an input or output record to
    process does it work?

    One possibility for your problem is that your Java server takes
    longer than 0.5 second to connect.   If a port has autoconnect
    enabled, then when the port is first connected asyn will try to
    connect to it, but it will only wait 0.5 seconds by default.  You
    can lengthen that time to 2 seconds, for example with this command
    before you create the IP port.

    asynSetAutoConnectTimeout 2.0

    You can also try to wait for the port to connect in your startup
    script with this command:

    asynWaitConnect(const char *portName, double timeout)

    i.e.

    asynWaitConnect("lambda1", 2.0)

    right after your drvAsynIPPortConfigure command.

    Mark

    ________________________________
    From: Pavel Maslov [[email protected]
    <mailto:[email protected]>]
    Sent: Friday, August 09, 2013 9:00 AM
    To: Mark Rivers; EPICS Tech Talk
    Subject: Re: [asyn] link already open!

    Hi Mark!

    The error occurs at iocInit (since my PVs have PINI=YES) and each
    time I read/write via CA.
    The server is a Java Device Simulator at localhost:7001. It is
    always running and it never disconnects. All of my PVs are marked
    Invalid. In fact they have not been initialized.
    I have tried with noAutoConnect=1 and this is what i get:

    epics> 2013/08/09 15:48:06.034504 CAS-client
    lambda-ps:PWR_OUTPUT:RBV lockRequest: pasynManager->queueRequest()
    failed: port lambda1 not connected


    epics> asynReport 2
    lambda1 multiDevice:No canBlock:Yes autoConnect:No
         enabled:Yes connected:Yes numberConnects 1
         nDevices 0 nQueued 0 blocked:No
         asynManagerLock:No synchronousLock:No
         exceptionActive:No exceptionUsers 2 exceptionNotifys 0
         interposeInterfaceList
             asynOctet pinterface 0x7fdceea29800 drvPvt 0x1c6f820
         interfaceList
             asynCommon pinterface 0x7fdceea26c60 drvPvt 0x1c6c270
             asynOctet pinterface 0x1c6c2f8 drvPvt 0x1c6c270
         Port 127.0.0.1:7001
    <http://127.0.0.1:7001><http://127.0.0.1:7001>: Connected
                         fd: 9
         Characters written: 0
            Characters read: 0




    --
    Regards,


    Pavel Maslov, MS


    On Fri, Aug 9, 2013 at 3:16 PM, Mark Rivers
    <[email protected]
    <mailto:[email protected]><mailto:[email protected]
    <mailto:[email protected]>>> wrote:
    Please provide some more information:

    - When does the error occur?  At iocInit when connecting to the
    device for the first time?  When the server first comes on line?
      When the server is restarted?

    - The server is at port 7001 on the localhost.  Is that server
    always running when the IOC is running?  Does the server disconnect
    after each transaction?

    You have created the drvAsynIPPort with the default value of 0 for
    the last 3 parameters, so it is using noAutoConnect=0, which means
    that asynManager will automatically try to connect the port before
    queuing a request.  If the connection attempt fails then asynManager
    will not queue the request.  So I am having a hard time
    understanding how StreamDevice found the port disconnected, unless
    your server disconnected in the time between when asynManager queued
    the request and when StreamDevice was called.

    Mark


    ________________________________
    From: [email protected]
    <mailto:[email protected]><mailto:[email protected]
    <mailto:[email protected]>>
    [[email protected]
    <mailto:[email protected]><mailto:[email protected]
    <mailto:[email protected]>>] on behalf of Pavel Maslov
    [[email protected]
    <mailto:[email protected]><mailto:[email protected]
    <mailto:[email protected]>>]
    Sent: Friday, August 09, 2013 4:20 AM
    To: EPICS Tech Talk
    Subject: [asyn] link already open!

    Hello all,

    When can this message pop up:

    2013/08/09 11:03:11.051131 lambda1 lambda-ps:CURR:MAX:RBV:
    pasynCommon->connect() failed: 127.0.0.1:7001
    <http://127.0.0.1:7001><http://127.0.0.1:7001><http://127.0.0.1:7001>:
    Link already open!
    2013/08/09 11:03:11.052968 lambda1 lambda-ps:CURR:MAX:RBV: Protocol
    aborted



    --
    Regards,


    Pavel Maslov, MS
    Controls Engineer





Replies:
Re: [asyn] link already open! Pavel Maslov
References:
[asyn] link already open! Pavel Maslov
RE: [asyn] link already open! Mark Rivers
Re: [asyn] link already open! Pavel Maslov
RE: [asyn] link already open! Mark Rivers
Re: [asyn] link already open! Pavel Maslov

Navigate by Date:
Prev: Re: vxWorks (tNetTask): arpresolve: lookup failed (resource shortage or network configuration error -- check netmask) Dirk Zimoch
Next: Re: [asyn] link already open! Pavel Maslov
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: [asyn] link already open! Mark Rivers
Next: Re: [asyn] link already open! Pavel Maslov
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 20 Apr 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·