Channel Access has a problem with changing runtime limits.
For a double-typed channel, a client could historically subscribe to DBR_TIME_DOUBLE to get timestamp, status, value,
or to DBR_CTRL_DOUBLE which sends all the limits, units, precision, …, and the value, but NOT THE TIME STAMP??!
So well-formed clients used to read the DBR_CTRL_DOUBLE once, then subscribe to the DBR_TIME_DOUBLE.
That way the client fetched the large and rarely changing CTRL info once, then only got the more efficient time/status/value updates.
That’s great for 99.76% of all use cases, but when you change the limits at runtime, you don’t see that in the client.
For a while there’s now a new DBE_PROPERTY modifier for the subscription that allows you do subscribe to the DBR_CTRL_DOUBLE data but only get updates when limits and units change. That’s the best of all
worlds:
Subscribe to property changes on DBR_CTRL_DOUBLE for the 0.24% use case, plus subscribe to the DBR_TIME_DOUBLE for the 99.76% use case.
.. except: Older IOCs and older gateways don’t support DBE_PROPERTY, so you should only enable that if everybody in your system can handle it.
See
https://control-system-studio.readthedocs.io/en/latest/preference_properties.html#pv-ca for the org.phoebus.pv.ca/dbe_property_supported setting to enable it.
See also
https://epics.anl.gov/tech-talk/2016/msg01005.php and
https://epics.anl.gov/tech-talk/2021/msg00030.php
-Kay
From:
Paul Sichta <psichta at pppl.gov>
Date: Wednesday, July 5, 2023 at 3:35 PM
To: Kasemir, Kay <kasemirk at ornl.gov>
Cc: tech-talk at aps.anl.gov <tech-talk at aps.anl.gov>
Subject: Re: [EXTERNAL] phoebus Tank widget: Limits from PV?
Kay,
Thanks for those tips. My database file has LOPR/HOPR as -140/160, but after the IOC is running the LOPR/HOPR are written with new values, e.g. -100/500.
When I use the caget command, the display limits show -100/500.
When I probe the tank widget (PV) in phoebus it shows, in the metadata section, display range of -140/160, and when I look carefully on the tank widget scale it also shows -140/160 range for the case where
I checkbox to use the PV Limits - so the PV Limits checkbox is working, but ....
How in the heck does phoebus know what the loaded database limits were, rather than reading the PV's current values? Is there a cache where it is read by phoebus one time or upon initial connection? I tried
restarting phoebus but it always thinks the display limits are the loaded database's -140/160.
When I try it with this type of record, tank & meter & progress bar all get the 0..10 range from the record:
record(calc, "ramp")
{
field(SCAN, "1 second")
field(INPA, "ramp")
field(CALC, "A<10?A+1:0")
field(HOPR, "10")
field(LOPR, "0")
}
In “probe” you should also see “Display Range: 0.0 .. 10.0”, and from a command line `caget -d CTRL_DOUBLE ramp` should show the same Lo and Hi disp
limit.
Hello,
I have used the checkbox to select "Limits from PV'' which I expected would be taken from LOPR and HOPR of the PV. That checkbox seems to make
no difference; the tank's range is always the Minimum and Maximum values used for the widget's properties. I see the same ignoring of PV limits for the meter and progress bar.
I'm using channel access for the PV's , and version master 2023-06-28 04:51, but some earlier versions I have do the same thing.