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  2022  2023  2024  2025  <2026 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  <2026
<== Date ==> <== Thread ==>

Subject: Re: ASYN parameter value vs VAL field relationship
From: André Favoto via Tech-talk <tech-talk at aps.anl.gov>
To: Tech Talk <tech-talk at aps.anl.gov>, André Favoto <andrefavotto at outlook.com>
Date: Mon, 22 Jun 2026 11:36:42 +0000
Sorry, I accidentally sent the message incomplete...

I am trying to control the upper limit for a given PV via asyn (same as DRVH does, but since the value is dynamic, I'd rather handle it in the driver instead of DB links).
I have the following record:

record(ao, "$(P)$(R)$(PUMP)MaxPressure") {
    field(DESC, "set max pressure for process")
    field(DTYP, "asynFloat64")
    field(EGU,  "bar")
    field(PREC, "2")
    field(OUT,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))PROC_MAX_PRESSURE")

    info(asyn:READBACK, "1")
}
And the asyn code that sets the value is

else if (function == procMaxPressure_) {
    double maxPressure;
    status = getDoubleParam(addr, syrMaxPressure_, &maxPressure);
    // do not allow process pressure to be set above syringe max pressure.
    if (value > maxPressure) {
      asynPrint(pasynUser, ASYN_TRACE_ERROR, "Pressure above syringe limit, clipping to %f\n", maxPressure);
      value = maxPressure;
    }
    if (value < 0) {
      value = 0;
    }
  }
Later on, inside writeFloat64, I do:

 if (status == asynSuccess && apiErrCode == ERR_NOERR) {
    setDoubleParam(addr, function, value);
    callParamCallbacks(addr);
    asynPrint(pasynUser, ASYN_TRACEIO_DRIVER, "%s:%s: port=%s, param=%s, value=%f, status=%d\n", driverName,
              functionName, this->portName, paramName, value, (int)status);
  } else {
(...)

What I would expect is that the record only assumes the value that I clipped, i.e., 0 <= value <= maxPressure

However, what I see is that the asyn parameter PROC_MAX_PRESSURE is indeed clipped, but the PV value assumes whatever value I put. Assuming maxPressure=517, asynReport gives:

Parameter 10 type=asynFloat64, name=PROC_MAX_PRESSURE, value=517, status=0

But I successfully wrote "600" to "$(P)$(R)$(PUMP)MaxPressure":

> dbgf B02-CSLab:SE-Pumps:SP1MaxPressure
DBF_DOUBLE:         600
I understand the asyn driver and the database are on different layers, but I would expect is that the PROC_MAX_PRESSURE param and VAL field of the record stayed in sync with the setup above.
Maybe I misinterpreted how that is supposed to behave?

I have seen the same behavior in other modules, so I'd like to check if someone has any ideas on how to handle this properly. 

Thanks, and sorry for the previous noise 🙂 

Cheers,
André Favoto



From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of André Favoto via Tech-talk <tech-talk at aps.anl.gov>
Sent: Monday, June 22, 2026 13:28
To: Tech Talk <tech-talk at aps.anl.gov>
Subject: ASYN parameter value vs VAL field relationship
 
Hi folks,
I am trying to control the upper limit for a given PV via asyn (same as DRVH does, but since the value is dynamic, I'd rather handle it in the driver instead of DB links).
I have the following record:

record(ao, "$(P)$(R)$(PUMP)MaxPressure") {
    field(DESC, "set max pressure for process")
    field(DTYP, "asynFloat64")
    field(EGU,  "bar")
    field(PREC, "2")
    field(OUT,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))PROC_MAX_PRESSURE")

    info(asyn:READBACK, "1")
}



Replies:
Re: ASYN parameter value vs VAL field relationship Jörn Dreyer via Tech-talk
References:
ASYN parameter value vs VAL field relationship André Favoto via Tech-talk

Navigate by Date:
Prev: ASYN parameter value vs VAL field relationship André Favoto via Tech-talk
Next: Re: ASYN parameter value vs VAL field relationship Jörn Dreyer 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  2022  2023  2024  2025  <2026
Navigate by Thread:
Prev: ASYN parameter value vs VAL field relationship André Favoto via Tech-talk
Next: Re: ASYN parameter value vs VAL field relationship Jörn Dreyer 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  2022  2023  2024  2025  <2026
ANJ, 22 Jun 2026 · Home · News · About · Talk · Base · Modules · Extensions ·
· Distributions · Download · Documents · Links · Licensing ·