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  <20162017  2018  2019  2020  2021  2022  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  <20162017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Autosave ignores PVs starting with some characters
From: "Konrad, Martin" <[email protected]>
To: Tim Mooney <[email protected]>, EPICS Tech Talk <[email protected]>
Date: Tue, 6 Sep 2016 21:09:01 +0000
Hi Tim,
I recently came across the following issue with Autosave: PV names
starting with '_' did not get saved. Comparing the source code with the
list of allowed characters (see chapter 6.3 General Rules for Database
Definition of the Application Developers Manual) revealed that all PVs
starting with one of the following characters will not be saved:

'_', '-', ':', '.', '[', ']', '<', '>', ';'

They make it into the automatically generated .req file but not into the
.sav file. The attached patch fixes the problem for me.

Thanks!

Martin

-- 
Martin Konrad
Control System Engineer
Facility for Rare Isotope Beams
Michigan State University
640 South Shaw Lane
East Lansing, MI 48824-1321, USA
Tel. 517-908-7253
Email: [email protected]
From: Martin Konrad <[email protected]>
Date: Tue, 6 Sep 2016 14:11:32 -0400
Subject: Allow special characters in PV names

---
 asApp/src/save_restore.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/asApp/src/save_restore.c b/asApp/src/save_restore.c
index 4a84d8c..c36efd6 100644
--- a/asApp/src/save_restore.c
+++ b/asApp/src/save_restore.c
@@ -454,6 +454,13 @@ void save_restoreSet_CallbackTimeout(int t) {
 
 /********************************* code *********************************/
 
+int isPVChar(char chr)
+{
+  return isalpha((int)chr) || isdigit((int)chr) || chr == '_' || chr == '-'
+      || chr == ':' || chr == '.' || chr == '[' || chr == ']' || chr == '<'
+      || chr == '>' || chr == ';';
+}
+
 int isAbsolute(const char* filename)
 {
 	if ( '/' == filename[0] )
@@ -3499,7 +3506,7 @@ STATIC int readReqFile(const char *reqFile, struct chlist *plist, char *macrostr
 			if (save_restoreDebug >= 2) printf("save_restore:readReqFile: calling readReqFile('%s', %p,'%s')\n",
 				templatefile, plist, new_macro);
 			readReqFile(templatefile, plist, new_macro);
-		} else if (isalpha((int)name[0]) || isdigit((int)name[0]) || name[0] == '$') {
+		} else if (isPVChar(name[0]) || name[0] == '$') {
 			pchannel = (struct channel *)calloc(1,sizeof (struct channel));
 			if (pchannel == (struct channel *)0) {
 				plist->status = SR_STATUS_WARN;

Replies:
RE: Autosave ignores PVs starting with some characters Mark S. Engbretson
RE: Autosave ignores PVs starting with some characters Mooney, Tim M.

Navigate by Date:
Prev: Re: Support for CAEN SY4527 Jiro Fujita
Next: RE: Autosave ignores PVs starting with some characters Mark S. Engbretson
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: ProcServ suggestion - add Date/Time to startup lines Mark Rivers
Next: RE: Autosave ignores PVs starting with some characters Mark S. Engbretson
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 07 Sep 2016 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·