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: streamDevice redirection-to-records & PVs that start with a number |
From: | Dirk Zimoch <[email protected]> |
To: | "Peterson, Kevin M." <[email protected]>, EPICS tech-talk <[email protected]> |
Date: | Wed, 14 Nov 2018 14:20:22 +0100 |
Hi Kevin,I have found the problem. It is an unexpected feature of dbNameToAddr combined with the way I resolve the record reference.
In StreamDevice %(redirect) can be %(record), %(record.field) or $(field), with the first meaning record.VAL and the last meaning current_record.field. So I first check if there is a '.' in the reference. In that case it's record.field.
If not, I first try if it's a field of the current record by calling dbNameToAddr("current_record.redirect").
In your case this should not match, because your redirect is the name of another record (starting with a number).
Now the unexpected dbNameToAddr() feature comes into play: If the field name does not start with a letter or underscore, it is ignored and dbNameToAddr succeeds and returns a reference to the VAL field.
Try this: dbgf existing_record.3whatever This creates a false match, so that case 3 (record.VAL) is never tested. I will fix the way how StreamDevice does the matching... Dirk On 14.11.2018 00:33, Peterson, Kevin M. via Tech-talk wrote:
FYI, I discovered that streamDevice's redirection-to-records feature fails if the name of the destination PV starts with a number: https://github.com/paulscherrerinstitute/StreamDevice/issues/20 There have been multiple times in the past where streamDevice support that used the redirection-to-records feature worked in my development IOC but didn't work when I deployed it to a beamline. This problem wasn't discovered then because eliminating redirection from the support was easier than troubleshooting the redirection failure. This problem is very likely to occur at the APS. The PV prefix for development IOCs is often the developer's initials. The beamlines are numbered and the PV prefix for beamline IOCs usually begins with the beamline number. I hope this saves someone else a little frustration. Kevin