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: 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:07:29 +0000 |
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?
–
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.
***************************************************************** 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 HI Henrique, I think the same happens to NDFileTemplate. HTH,
On Wed, Jun 1, 2016 at 2:25 PM, Henrique Almeida <[email protected]> wrote: Hello, while constructing an areaDetector object, I'm unable to |