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

Subject: RE: EPICS compilation errors
From: Mark Rivers via Tech-talk <tech-talk at aps.anl.gov>
To: Andrew Johnson <anj at anl.gov>, Adrian Martinez <adrian.martinez at orolia.com>
Cc: tech-talk <tech-talk at aps.anl.gov>
Date: Tue, 12 Jul 2022 16:02:25 +0000

Ø  This description implies that some iocsh callable routine probably needs to make a strcpy() of its parameter name string argument, or to change it from iocshArgString to iocshArgPersistentString in the iocshArg definition (which does that for you).

 

I don’t think that is likely to be the problem for 2 reasons:

-          I don’t think these parameter names are passed via iocsh callable functions, they are hardcoded in the driver.

-          asynPortDriver::createParam(const char *name, asynParamType type, int *index) passes the pointer to the parameter name to one of these paramVal constructors

 

paramVal::paramVal(const char *name):

    type(asynParamNotDefined), status_(asynSuccess), alarmStatus_(0), alarmSeverity_(0),

    valueDefined(false), valueChanged(false)

{

    this->name = epicsStrDup(name);

}

 

paramVal::paramVal(const char *name, asynParamType type):

    type(type), status_(asynSuccess), alarmStatus_(0), alarmSeverity_(0),

    valueDefined(false), valueChanged(false){

    this->name = epicsStrDup(name);

    memset(&this->data, 0, sizeof(this->data));

}

 

Note that both of these copy the name to the paramVal object using epicsStrDup, so they do not assume a persistent pointer.

 

Mark

 

 

From: Andrew Johnson <anj at anl.gov>
Sent: Tuesday, July 12, 2022 10:17 AM
To: Mark Rivers <rivers at cars.uchicago.edu>; Adrian Martinez <adrian.martinez at orolia.com>
Cc: tech-talk <tech-talk at aps.anl.gov>
Subject: Re: EPICS compilation errors

 

 

On 7/12/22 7:24 AM, Mark Rivers via Tech-talk wrote:

Hi Adrian,

 

Your parameter library looks fine before iocInit, but after iocInit all of the parameter names have changed to either an empty string "", or "BPM1".

 

Does your driver implement the drvUserCreate() method?  If so, that gets called during iocInit and perhaps you have an error in that method.  The names of the parameters should not be changing after they are created.

 

The only parameter whose name has not changed after iocInit is this one:

 

Parameter 28 type=asynInt32, name=enable_compensation, value=0, status=0

 

Perhaps that is a clue?


This description implies that some iocsh callable routine probably needs to make a strcpy() of its parameter name string argument, or to change it from iocshArgString to iocshArgPersistentString in the iocshArg definition (which does that for you).

- Andrew


-- 
Complexity comes for free, Simplicity you have to work for.

References:
EPICS compilation errors Adrian Martinez via Tech-talk
RE: EPICS compilation errors Mark Rivers via Tech-talk
RE: EPICS compilation errors Adrian Martinez via Tech-talk
Re: EPICS compilation errors Mark Rivers via Tech-talk
RE: EPICS compilation errors Adrian Martinez via Tech-talk
RE: EPICS compilation errors Mark Rivers via Tech-talk
RE: EPICS compilation errors Adrian Martinez via Tech-talk
RE: EPICS compilation errors Adrian Martinez via Tech-talk
Re: EPICS compilation errors Mark Rivers via Tech-talk
Re: EPICS compilation errors Andrew Johnson via Tech-talk

Navigate by Date:
Prev: Lowest compatible version of asyn for base 3-15.9 Timothy Speight - STFC UKRI via Tech-talk
Next: RE: Lowest compatible version of asyn for base 3-15.9 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  2021  <20222023  2024 
Navigate by Thread:
Prev: Re: EPICS compilation errors Andrew Johnson via Tech-talk
Next: EPICS-Support for Owis motor stages Sintschuk, Michael 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  <20222023  2024 
ANJ, 14 Sep 2022 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·