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 2025 | 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 2025 |
<== 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:51:19 +0000 |
Note that the use of the drvUser interface to parse the drvInfo field into pasynUser->reason in my previous reply is just one example of how that interface can be used. The documentation on the drvUser interface is here: https://epics-modules.github.io/master/asyn/R4-41/asynDriver.html#asynDrvUser
It shows that the interface is actually independent of EPICS records and the use of the drvInfo field in the link. Mark From: Mark Rivers
> 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> 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 |