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

Subject: RE: Unable to initialize parameter with setStringParam()
From: Mark Rivers <[email protected]>
To: "'Bruno Martins'" <[email protected]>, "'Henrique Almeida'" <[email protected]>
Cc: "'[email protected] Talk'" <[email protected]>
Date: Wed, 1 Jun 2016 19:26:47 +0000

Ø  It would probably be a good idea to add the initial read from the driver in devAsynOctet::init_record for the output records.

 

I have created a new issue for this:

 

https://github.com/epics-modules/asyn/issues/24

 

Mark

 

 

From: Mark Rivers
Sent: Wednesday, June 01, 2016 2:07 PM
To: 'Bruno Martins'; Henrique Almeida
Cc: [email protected] Talk
Subject: RE: Unable to initialize parameter with setStringParam()

 

Hi Henrique,

 

Bruno is correct. 

 

The following is from the asyn training talk I gave last week at the EPICS Collaboration Meeting.

 

*****************************************************************

Where does an output record (ao, longout, mbbo, etc.) get its initial value?

  1. From the aoRecord.dbd file
  2. From the database file you load
  3. asyn device support init_record function does a read from your asyn driver to read the current value. 

     If your driver returns asynSuccess on that read then that value is used. 

     Supports bumpless reboots.

     If using asynPort driver then if your driver has done setIntegerParam, setDoubleParam, or setStringParam before init_record (i.e. typically in constructor) then the readInt32, etc. functions will return asynSuccess.  If setInt32Param has not been done then readInt32 returns asynError, and that value will not be used.

  1. From save/restore
  2. dbpf at the end of startup script.

*****************************************************************

 

The information above is correct for the standard asyn device support for numeric interfaces (asynInt32, asynUInt32Digital, asynFloat64).  However, I just looked at the code in devAsynOctet.c and that does NOT do step 3) above, i.e. read the value from the driver in init_record().  So stringout and waveform output records will not get initialized with the value you set in your driver, and the statement 3) is incorrect for setStringParam.

 

In your case if you only want the _RBV values to be correct then you should be able to do the following. In your driver’s template file, i.e. change PINI=YES to PINI=NO for those 2 output records.

 

# File template

record(waveform, "$(P)$(R)FileTemplate")

{

    field(PINI, "NO")

}

 

record(stringout, "$(P)$(R)TempSuffix")

{

    field(PINI, "NO")

}

 

This will prevent EPICS from writing the “” strings to your driver, and the value you set in your constructor should appear in the _RBV records.

 

It would probably be a good idea to add the initial read from the driver in devAsynOctet::init_record for the output records.

 

Mark

 

 

 

From: [email protected] [mailto:[email protected]] On Behalf Of Bruno Martins
Sent: Wednesday, June 01, 2016 1:45 PM
To: Henrique Almeida
Cc: [email protected] Talk
Subject: Re: Unable to initialize parameter with setStringParam()

 

HI Henrique,

I think what is happening is that NDFileTempSuffix has its associated $(P)$(R)TempSuffix record with PINI=YES and VAL="", so the record initialization that happens after your constructor is clearing the value (https://github.com/areaDetector/ADCore/blob/master/ADApp/Db/NDFile.template#L366).

I think the same happens to NDFileTemplate.

HTH,



Bruno

 

On Wed, Jun 1, 2016 at 2:25 PM, Henrique Almeida <[email protected]> wrote:

 Hello, while constructing an areaDetector object, I'm unable to
successfully initialize string parameters with setStringParam(). For
example, calling setStringParam(NDFileTemplate, "abcd") or
setStringParam(NDFileTempSuffix, "xyz") has no effect and the
corresponding PVs, FileTemplate_RBV and TempSuffix_RBV stay empty. Any
help ?

 Note: I can successfully initialize integer parameters with setIntegerParam().

 


References:
Unable to initialize parameter with setStringParam() Henrique Almeida
Re: Unable to initialize parameter with setStringParam() Bruno Martins
RE: Unable to initialize parameter with setStringParam() Mark Rivers

Navigate by Date:
Prev: RE: Unable to initialize parameter with setStringParam() Mark Rivers
Next: Windows IOC time error messages Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: Unable to initialize parameter with setStringParam() Mark Rivers
Next: Windows IOC time error messages Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 15 Jul 2016 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·