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  <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  2019  2020  2021  2022  2023  <2024
<== Date ==> <== Thread ==>

Subject: Re: get asyn hostInfo
From: Mark Rivers via Tech-talk <tech-talk at aps.anl.gov>
To: Douglas Araujo <douglas.araujo at ess.eu>
Cc: "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Thu, 4 Apr 2024 15:11:58 +0000
pasynOption->getOption(asynOptionPvt, pasynUserOctet_, "hostInfo", hostbuff, 100 );

It looks like you are not checking the status return of that call.  What does it return?  Please print out the return value.

You are printing the error message:

std::cout << pasynUserOctet_->errorMessage << std::endl;

regardless of the return value of that function.  That could be a stale error message.

Mark



From: Douglas Araujo <douglas.araujo at ess.eu>
Sent: Thursday, April 4, 2024 7:16 AM
To: Mark Rivers <rivers at cars.uchicago.edu>
Cc: tech-talk at aps.anl.gov <tech-talk at aps.anl.gov>
Subject: Re: get asyn hostInfo
 

Oh, my apologies! I omitted part of the line...

The complete line is:

pasynOption->getOption(asynOptionPvt, pasynUserOctet_, "hostInfo", hostbuff, 100 );

(gdb) p pasynOption
$6 = (asynOption *) 0x7ffff624fcd0 <drvAsynIPPortAsynCommon>


I assume that I am utilizing the following function:


From: Mark Rivers <rivers at cars.uchicago.edu>
Sent: Thursday, April 4, 2024 3:51:19 PM
To: Douglas Araujo
Cc: tech-talk at aps.anl.gov
Subject: Re: get asyn hostInfo
 
Hi Douglas,

In this line of code: 
  •  getOption(asynOptionPvt, pasynUserOctet_, "hostInfo", hostbuff, 100 );

where is the getOption() function defined? Is that a function you wrote?  Because in asynRecord the code is this:

 pasynRecPvt->pasynOption->getOption(pasynRecPvt->asynOptionPvt, pasynUser,

Mark


From: Douglas Araujo <douglas.araujo at ess.eu>
Sent: Thursday, April 4, 2024 6:15 AM
To: Mark Rivers <rivers at cars.uchicago.edu>
Cc: tech-talk at aps.anl.gov <tech-talk at aps.anl.gov>
Subject: Re: get asyn hostInfo
 

Sure, perhaps I haven't made myself clear, but the code I included in the question is indeed mine. Now, I'm providing the specific block for clarity.

RMMRegisterAccess::RMMRegisterAccess(const std::string& address_info) {
  connect(address_info);
   ...
  asynInterface *pasynInterface;

  pasynInterface = pasynManager->findInterface(pasynUserOctet_, asynCommonType, 1);
  void *asynOptionPvt;
  asynOption *pasynOption;
  pasynOption = (asynOption *) pasynInterface->pinterface;
  asynOptionPvt = pasynInterface->drvPvt;
 
  char hostbuff[100];

  getOption(asynOptionPvt, pasynUserOctet_, "hostInfo", hostbuff, 100 );
  std::cout << pasynUserOctet_->errorMessage << std::endl;
}

asynStatus RMMRegisterAccess::connect(const std::string& address_info) {
 
// where address_info is the portName defined in the drvAsynIPPortConfigure
  return pasynOctetSyncIO->connect(address_info.c_str(), 0, &pasynUserOctet_, NULL); 
}

Douglas

From: Mark Rivers <rivers at cars.uchicago.edu>
Sent: Thursday, April 4, 2024 2:59:14 PM
To: Douglas Araujo
Cc: tech-talk at aps.anl.gov
Subject: Re: get asyn hostInfo
 
Can you share your code?

Sent from my iPhone

On Apr 4, 2024, at 8:50 AM, Douglas Araujo <douglas.araujo at ess.eu> wrote:



Yes, I have confirmed that the value in theHOSTINFO asyn record field is correct:

$ pvget asyn:Test.HOSTINFO
asyn:Test.HOSTINFO <undefined>              "192.168.50.2:65535 UDP"

I also assumed that this should work, but for some reason, I am receiving the error:
192.168.50.2:65535 UDP: Link already open!
So, I am wondering if the instance of pasynOption that I created is receiving the same pasynInterface value that was defined with drvAsynIPPortConfigure and is also being used in the asyn record code.

Douglas

From: Mark Rivers <rivers at cars.uchicago.edu>
Sent: Thursday, April 4, 2024 2:02:03 PM
To: tech-talk at aps.anl.gov; Douglas Araujo
Subject: Re: get asyn hostInfo
 
If you open the asynRecord OPI screen asynIPPortSetup does it correctly display the current IP host information in the widget labeled "Host info:"?  If so, then using the same code as in the asynRecord should work?

Mark


From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Douglas Araujo via Tech-talk <tech-talk at aps.anl.gov>
Sent: Thursday, April 4, 2024 2:48 AM
To: tech-talk at aps.anl.gov <tech-talk at aps.anl.gov>
Subject: get asyn hostInfo
 

Hi all, 

Does anyone know how to read the hostInfo value that is passed into the  drvAsynIPPortConfigure function ?

Basically, I have this in my startup script:
epicsEnvSet("IPADDR", "192.168.50.2")
epicsEnvSet("IPPORT", "65535")
drvAsynIPPortConfigure("L0", "$(IPADDR):$(IPPORT) UDP", 0, 0, 1)


And in my c++ code:
status = pasynOctetSyncIO->connect(address_info.c_str(), 0, &pasynUserOctet_, NULL); // where address_info is the portName

So, I tried following the steps inside asynRecord.c:

asynInterface *pasynInterface;
pasynInterface = pasynManager->findInterface(pasynUserOctet_, asynCommonType, 1);
void *asynOptionPvt;
asynOption *pasynOption;
pasynOption = (asynOption *) pasynInterface->pinterface;
asynOptionPvt = pasynInterface->drvPvt;
char hostbuff[100];
getOption(asynOptionPvt, pasynUserOctet_, "hostInfo", hostbuff, 100 );
std::cout << pasynUserOctet_->errorMessage << std::endl;

But I received the message error:
192.168.50.2:65535 UDP: Link already open!

Thanks in advance. -- Douglas Araujo

Replies:
Re: get asyn hostInfo Douglas Araujo via Tech-talk
References:
get asyn hostInfo Douglas Araujo via Tech-talk
Re: get asyn hostInfo Mark Rivers via Tech-talk
Re: get asyn hostInfo Douglas Araujo via Tech-talk
Re: get asyn hostInfo Mark Rivers via Tech-talk
Re: get asyn hostInfo Douglas Araujo via Tech-talk
Re: get asyn hostInfo Mark Rivers via Tech-talk
Re: get asyn hostInfo Douglas Araujo via Tech-talk

Navigate by Date:
Prev: Re: get asyn hostInfo Douglas Araujo via Tech-talk
Next: Re: get asyn hostInfo Douglas Araujo 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  <2024
Navigate by Thread:
Prev: Re: get asyn hostInfo Douglas Araujo via Tech-talk
Next: Re: get asyn hostInfo Douglas Araujo 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  <2024
ANJ, 04 Apr 2024 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·