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

Subject: RE: ASYN 4-14 & AsynPortDriver class changes
From: "Mark Rivers" <[email protected]>
To: <[email protected]>, <[email protected]>
Date: Tue, 24 Aug 2010 23:59:55 -0500
Hi Euan,
 
I realized that using enum's as was done in 4-12 was not a good idea.  It meant that an asynPortDriver could not implement parameters from more than one driver class, because they will conflict.  We ran into this in real life when writing a driver that implemented both the MCA and areaDetector parameters.
 
What asyn drivers should publish is only the set of drvInfo strings that they support, and asynPort driver has been changed to do this.
 
You should look at the testAsynPortDriverApp application, which is part of asyn, for an example of the new way to do this.
 
This is from that application:
/* These are the drvInfo strings that are used to identify the parameters.

* They are used by asyn clients, including standard asyn device support */

#define P_RunString "SCOPE_RUN" /* asynInt32, r/w */

#define P_MaxPointsString "SCOPE_MAX_POINTS" /* asynInt32, r/o */

#define P_TimePerDivisionString "SCOPE_TIME_PER_DIV" /* asynFloat64, r/w */

#define P_VoltsPerDivisionString "SCOPE_VOLTS_PER_DIV" /* asynFloat64, r/w */

#define P_VoltOffsetString "SCOPE_VOLT_OFFSET" /* asynFloat64, r/w */

#define P_TriggerDelayString "SCOPE_TRIGGER_DELAY" /* asynFloat64, r/w */

...

    createParam(P_RunString, asynParamInt32, &P_Run);

    createParam(P_MaxPointsString, asynParamInt32, &P_MaxPoints);

    createParam(P_TimePerDivisionString, asynParamFloat64, &P_TimePerDivision);    

    createParam(P_VoltsPerDivisionString, asynParamFloat64, &P_VoltsPerDivision);

    createParam(P_VoltOffsetString, asynParamFloat64, &P_VoltOffset);

    createParam(P_TriggerDelayString, asynParamFloat64, &P_TriggerDelay);

...

    if (function == P_UpdateTime) {

        /* Make sure the update time is valid. If not change it and put back in parameter library */

        if (value < MIN_UPDATE_TIME) {

        value = MIN_UPDATE_TIME;

        setDoubleParam(P_UpdateTime, value);

    }

So now you call createParam, passing it the drvInfo string and the parameter type, and it returns an index for that parameter.  You then use that index to access the parameter library.

Mark

 

________________________________

From: [email protected] on behalf of [email protected]
Sent: Tue 8/24/2010 7:16 PM
To: [email protected]
Subject: ASYN 4-14 & AsynPortDriver class changes



Hi,

In the current release of AsynPortDriver the code that supported the asynParamString_t structure has been removed. What's the best way to replace a list of parameters which are set up like these:
typedef enum {
    paramCtrlIntrTopIs,       //FPGA top-level interrupt summary register
    paramCtrlIntrTopIsMsk,       //FPGA top-level interrupt summary register.
    paramCtrlSysIntr,       //SYS interrupt event register.
    paramCtrlSysIntrMsk,       //SYS interrupt event enable register.
    paramCtrlSysGoodbeef,       //System goodbeef register.

} askapAsynDrvParams;


static asynParamString_t driverParamString[] = {
    {paramCtrlIntrTopIs,        "CTRL_INTR_TOP_IS"},
    {paramCtrlIntrTopIsMsk,        "CTRL_INTR_TOP_IS_MSK"},
    {paramCtrlSysIntr,        "CTRL_SYS_INTR"},
    {paramCtrlSysIntrMsk,        "CTRL_SYS_INTR_MSK"},
    {paramCtrlSysGoodbeef,        "CTRL_SYS_GOODBEEF"},

};

with a list that would be parsed automatically by drvUserCreate as these were in ASYN 4-12?

cheers,

Euan.






References:
ASYN 4-14 & AsynPortDriver class changes Euan.Troup

Navigate by Date:
Prev: ASYN 4-14 & AsynPortDriver class changes Euan.Troup
Next: Re: msi again Benjamin Franksen
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: ASYN 4-14 & AsynPortDriver class changes Euan.Troup
Next: RE: atomic operations in base Jeff Hill
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 02 Sep 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·