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: Re: Autosave ignores PVs starting with some characters
From: "Konrad, Martin" <[email protected]>
To: Ralph Lange <[email protected]>, "J. Lewis Muir" <[email protected]>, Andrew Johnson <[email protected]>
Cc: "[email protected]" <[email protected]>
Date: Thu, 8 Sep 2016 17:54:03 +0000
Hi all,
>>>> Turns out EPICS won't load a record whose name starts with '.'
'.' is used as a separator between the record name and the field name. I
guess record names of length 0 are not allowed. Thus a valid PV name can
never start with a '.' and we should remove it from the list of
characters in my patch. I updated my patch accordingly.

I'm still a bit confused about the fact that 6.4.11.2 allows '+' as part
of the record name. However '+' seems not to be allowed in PV names.
Isn't this calling for trouble? Can someone please shine some light on this?

Regarding '_', '-', ':', '[', ']', '<', '>', and ';' I don't see any
reason why they shouldn't be allowed at the beginning of a record/PV
name. These characters might not be my first choice to start a record
name with but they seem to be allowed and in my mind should be handled
by Autosave like alpha-numeric characters.

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 08eef6b9d3a1b841400e831d611df8c3471c16ba Mon Sep 17 00:00:00 2001
From: Martin Konrad <[email protected]>
Date: Tue, 6 Sep 2016 14:11:32 -0400
Subject: [PATCH] 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..95a680a 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 isValid1stPVChar(char chr)
+{
+  return isalpha((int)chr) || isdigit((int)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 (isValid1stPVChar(name[0]) || name[0] == '$') {
 			pchannel = (struct channel *)calloc(1,sizeof (struct channel));
 			if (pchannel == (struct channel *)0) {
 				plist->status = SR_STATUS_WARN;
-- 
2.7.4


Replies:
Re: Autosave ignores PVs starting with some characters Eric Norum
Re: Autosave ignores PVs starting with some characters Andrew Johnson
References:
Autosave ignores PVs starting with some characters Konrad, Martin
RE: Autosave ignores PVs starting with some characters Mooney, Tim M.
RE: Autosave ignores PVs starting with some characters Mooney, Tim M.
Re: Autosave ignores PVs starting with some characters Andrew Johnson
Re: Autosave ignores PVs starting with some characters J. Lewis Muir

Navigate by Date:
Prev: Re: Autosave ignores PVs starting with some characters Ralph Lange
Next: Re: Autosave ignores PVs starting with some characters Eric Norum
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: Autosave ignores PVs starting with some characters Andrew Johnson
Next: Re: Autosave ignores PVs starting with some characters Eric Norum
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, 08 Sep 2016 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·