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

Subject: Re: Dynamically changing HIHI PV field
From: Andrew Johnson via Tech-talk <tech-talk at aps.anl.gov>
To: "Marco A. Barra Montevechi Filho" <marco.filho at lnls.br>, "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Tue, 12 Apr 2022 13:17:43 -0500
Hi Marco,

On 4/12/22 8:39 AM, Marco A. Barra Montevechi Filho via Tech-talk wrote:
I have an equipment which has the HIGH field configurable in the hardware. We already have a PV that reads it, but it is currently an entire PV, and not a field of another existing PV.
Im trying to get that PV result and put it in the HIGH field of another PV. Something like:

record(ai, "MY:PV") {
  field(HIHI, 10)
  field(HIGH, "ANOTHER:PV:HIGH:LIMIT PP")
  field(LOW, -1)
  field(LOLO, -5)
  field(HHSV, MAJOR)
  field(HSV, MINOR)
  field(LSV, MINOR)
  field(LLSV, MAJOR)
}

but each try of mine gets either syntax error or 'Can't set "MY:PV.HIGH" to "ANOTHER:PV:HIGH:LIMIT"'. Am i doing something wrong? Is this approach even possible?
To explain the "why" behind Torsten's answer, you can look up the data type of the ai record's HIGH field on it's Record Reference page:

Field Summary Type DCT Default Read Write CA PP
HIHI Hihi Alarm Limit DOUBLE Yes   Yes Yes Yes
HIGH High Alarm Limit DOUBLE Yes   Yes Yes Yes
LOW Low Alarm Limit DOUBLE Yes   Yes Yes Yes
LOLO Lolo Alarm Limit DOUBLE Yes   Yes Yes Yes

The type given there is DOUBLE, so you can only set the field to a value which is a double-precision floating point number — that's why you were getting those errors, it can't accept a PV name. If you want the high alarm limit of your ai record to be updated whenever the value reported from the hardware changes you have to arrange for some other record to copy the new value there. Torsten's ao record demonstrates one way to do this (there are others which might be appropriate in different circumstances):

record(ao, "$(PREFIX)$(MOTOR_NAME)-CfgVELO-RB_")

{

    field(PREC, "$(PREC)")

    field(DOL,  "$(PREFIX)$(MOTOR_NAME)-CfgVELO-RB CP")

    field(OUT,  "$(PREFIX)$(MOTOR_NAME).VELO")

    field(OMSL, "closed_loop")

}

The DOL and OUT fields of the ao record type are both links; DOL is an INLINK (input link), so it fetches a value from the record named in the field, and OUT is an OUTLINK (output link), so it writes a value to the named record. The CP flag at the end of the input link tells the record to monitor that PV using Channel Access, and to cause the ao record to be processed whenever the value changes thus sending the new value to the other record. Using CP on an input link is normally better than making the record process at some periodic rate because it will process immediately, but only when it actually needs to.

- Andrew
-- 
Complexity is free, it's Simplicity that takes work.

References:
Dynamically changing HIHI PV field Marco A. Barra Montevechi Filho via Tech-talk

Navigate by Date:
Prev: Re: Dynamically changing HIHI PV field Marco A. Barra Montevechi Filho via Tech-talk
Next: Phoebus - xygraph print question Amien Crombie 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  2025 
Navigate by Thread:
Prev: Re: Dynamically changing HIHI PV field Marco A. Barra Montevechi Filho via Tech-talk
Next: Phoebus - xygraph print question Amien Crombie 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  2025 
ANJ, 14 Sep 2022 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions ·
· Download · Search · IRMIS · Talk · Documents · Links · Licensing ·