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  <20212022  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  <20212022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Purpose of the asynDrvUserMask interface
From: Mark Rivers via Tech-talk <tech-talk at aps.anl.gov>
To: Abdalla Ahmad <Abdalla.Ahmad at sesame.org.jo>
Cc: "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Sun, 25 Apr 2021 12:43:42 +0000

> The solution was to include “asynDrvUserMask” as part of the interface mask in the base class constructor even though 

> I am not using drvUserCreate method (But I am using pasynOctetSyncIO). 

> This was the call to the base class constructor:

> asynPortDriver(port_name, 255, asynInt32Mask | asynFloat64Mask | asynDrvUserMask, 

> 0, ASYN_CANBLOCK | ASYN_MULTIDEVICE, 1, 0, 0)

> So what is the purpose of this interface?

 

The asynDrvUser interface is used to parse the drvInfo string in the record link string:

 

   field(OUT,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))SCOPE_VOLT_OFFSET")

 

In the above example SCOPE_VOLT_OFFSET is the drvInfo string. 

 

In the asynPortDriver base class implementation that string is converted to the integer pasynUser->reason.  But your driver can override that method to handle the drvInfo string differently.

 

The drvUser interface is optional, although it is needed if your driver will handle multiple parameters, which nearly all drivers do.

 

Mark

 

 

 

 


From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Abdalla Ahmad via Tech-talk <tech-talk at aps.anl.gov>
Sent: Sunday, April 25, 2021 3:42 AM
To: tech-talk at aps.anl.gov
Subject: Purpose of the asynDrvUserMask interface

 

Hi

 

I am working on a driver based on asynPortDriver interface, the problem is that this statement

 

int function = pasynUser->reason;

 

Will always return 0 no matter which parameter string I pass in the INP field. The solution was to include “asynDrvUserMask” as part of the interface mask in the base class constructor even though I am not using drvUserCreate method (But I am using pasynOctetSyncIO). This was the call to the base class constructor:

 

asynPortDriver(port_name, 255, asynInt32Mask | asynFloat64Mask | asynDrvUserMask, 0, ASYN_CANBLOCK | ASYN_MULTIDEVICE, 1, 0, 0)

 

So what is the purpose of this interface?

 

Best Regards,

Abdalla


Replies:
RE: Purpose of the asynDrvUserMask interface Mark Rivers via Tech-talk
References:
Purpose of the asynDrvUserMask interface Abdalla Ahmad via Tech-talk

Navigate by Date:
Prev: RE: RPM packages for EPICS Abdalla Ahmad via Tech-talk
Next: RE: Purpose of the asynDrvUserMask interface 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  <20212022  2023  2024 
Navigate by Thread:
Prev: Purpose of the asynDrvUserMask interface Abdalla Ahmad via Tech-talk
Next: RE: Purpose of the asynDrvUserMask interface 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  <20212022  2023  2024 
ANJ, 25 Apr 2021 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·