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  <20212022  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  2016  2017  2018  2019  2020  <20212022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: PINI field for lsi record doesn't seem to work?
From: "Johnson, Andrew N. via Tech-talk" <tech-talk at aps.anl.gov>
To: "Wang, Andrew" <wang126 at llnl.gov>
Cc: EPICS tech-talk <tech-talk at aps.anl.gov>
Date: Fri, 18 Jun 2021 17:44:07 +0000
Hi Andy,

On Jun 18, 2021, at 12:31 PM, Wang, Andrew via Tech-talk <tech-talk at aps.anl.gov> wrote:

I have a simple lsi record shown below.
 
record(lsi, “joke_record”) 
{
              field(SIZV,  128)
              field(VAL,  "If you read this, tell me a funny joke")
              field(PINI, “YES”)
}
 
When I start up the IOC and do a caget on “joke_record”, I do not get the initial value. Feel like there is something very simple I forgot…

The VAL field of an lsi record is an array, which gets allocated at record initialization time. That happens during iocInit, which is some time after the .db file has been loaded so there’s nowhere for the IOC to actually store your string. The PINI field is irrelevant to that.

The simplest way to initialize an lsi record’s VAL field is to set its INP field like this:

record(lsi, "lsi") {
  field(SIZV, 80)
  field(INP, ["This is a long string with more than 40 characters"])
}

The square brackets around the string literal ensure that the IOC doesn’t assume that what you’re giving it is a PV name. Without them the IOC would make the INP field a link to a record called “This”, either locally or over CA.

There is no need to set PINI, the initialization of the VAL field will happen during iocInit.

HTH,

- Andrew

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


Replies:
RE: PINI field for lsi record doesn't seem to work? Wang, Andrew via Tech-talk
RE: PINI field for lsi record doesn't seem to work? Wang, Andrew via Tech-talk
References:
PINI field for lsi record doesn't seem to work? Wang, Andrew via Tech-talk

Navigate by Date:
Prev: Re: PINI field for lsi record doesn't seem to work? Mark Rivers via Tech-talk
Next: RE: PINI field for lsi record doesn't seem to work? Wang, Andrew 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  <20212022  2023  2024 
Navigate by Thread:
Prev: Re: PINI field for lsi record doesn't seem to work? Johnson, Andrew N. via Tech-talk
Next: RE: PINI field for lsi record doesn't seem to work? Wang, Andrew 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  <20212022  2023  2024 
ANJ, 18 Jun 2021 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·