EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024  Index 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: [Bug 1882520] Re: Constant arrary input links of size 1 don't work
From: Andrew Johnson via Core-talk <core-talk at aps.anl.gov>
To: core-talk at aps.anl.gov
Date: Tue, 09 Jun 2020 23:24:44 -0000
I think a bigger surprise would be a site that developed a record naming
convention that carefully followed our published naming rules and then
found out that they can't upgrade EPICS because we changed those rules.
Some EPICS sites don't have developers who have time to read every tech-
talk message, and that possibility troubles me.


If you don't like surprises, don't use the [] constant array syntax at all, use {const:[...]} instead as the JSON parser does follow the spec. The current parser (without your change) gives these occasionally surprising results:

field(INP, [1])     INP : DB_LINK [1] NPP NMS
field(INP, [1,2])   INP : CONSTANT [1,2]
field(INP, "[1]")   INP : DB_LINK [1] NPP NMS
field(INP, "[1,2]") INP : CONSTANT [1,2]
field(INP, [a])     INP : CONSTANT ["a"]
field(INP, [a,b])   INP : CONSTANT ["a","b"]
field(INP, "[a]")   INP : DB_LINK [a] NPP NMS
field(INP, "[a,b]") INP : CONSTANT [a,b]    <-- This generates a parse error at iocInit

The INP: part on each line is from a dbpr of the record and shows
plink->type.

Applying your patch converts the 3 DB_LINKs into CONSTANTs, and adds a
second parse error:

field(INP, [1])     INP : CONSTANT [1]
field(INP, [1,2])   INP : CONSTANT [1,2]
field(INP, "[1]")   INP : CONSTANT [1]
field(INP, "[1,2]") INP : CONSTANT [1,2]
field(INP, [a])     INP : CONSTANT ["a"]
field(INP, [a,b])   INP : CONSTANT ["a","b"]
field(INP, "[a]")   INP : CONSTANT [a]      <-- Parse error at iocInit
field(INP, "[a,b]") INP : CONSTANT [a,b]    <-- Parse error at iocInit

Links that give parse errors do not initialize their record at all. I
know exactly why they happen so don't waste time investigating them, I
have a fix in the works when we introduce the JSON-5 version of the YAJL
parser, although putting array constants inside quotes isn't really
correct anyway.

-- 
You received this bug notification because you are a member of EPICS
Core Developers, which is subscribed to EPICS Base.
Matching subscriptions: epics-core-list-subscription
https://bugs.launchpad.net/bugs/1882520

Title:
  Constant arrary input links of size 1 don't work

Status in EPICS Base:
  In Progress

Bug description:
  Constant input links in array form with 1 element don't work and
  return an empty array.

  Example:
  field (INP, [42])

  As soon as a comma is present, it works:
  field (INP, [42,])

To manage notifications about this bug go to:
https://bugs.launchpad.net/epics-base/+bug/1882520/+subscriptions

References:
[Bug 1882520] [NEW] Constant arrary input links of size 1 don't work Dirk Zimoch via Core-talk

Navigate by Date:
Prev: Re: DBR_VFIELD and complex field types Johnson, Andrew N. via Core-talk
Next: RE: BETA: ci-scripts 3.0 (feat. Windows on Travis) Mark Rivers via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024 
Navigate by Thread:
Prev: Re: [Bug 1882520] Re: Constant arrary input links of size 1 don't work Ben Franksen via Core-talk
Next: [Bug 1882520] Re: Constant arrary input links of size 1 don't work mdavidsaver via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024 
ANJ, 13 Jun 2020 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·