EPICS Home

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  Index 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021 
<== Date ==> <== Thread ==>

Subject: AW: Opinions please, what should this database do
From: "Zimoch Dirk \(PSI\) via Core-talk" <core-talk at aps.anl.gov>
To: "'core-talk at aps.anl.gov'" <core-talk at aps.anl.gov>
Date: Mon, 31 Aug 2020 11:17:02 +0000

What if the source record is an array of strings? Concatenate the strings? Take only the first one? Try to parse numbers from the elements?

What it that source string array contains 1 element?

 

Von: Zimoch Dirk (PSI)
Gesendet: Montag, 31. August 2020 13:03
An: 'Johnson, Andrew N.' <anj at anl.gov>
Betreff: AW: Opinions please, what should this database do

 

I don't know if that change would break things in case the arrays are really meant to be arrays of 8-bit integers, not long strings.

 

Would anyone want to convert the string "42" to the 1 element array [42] instead of to ['4','2',0]'? Who knows?

Unlikely maybe.

 

Dirk

 

Von: Core-talk <core-talk-bounces at aps.anl.gov> Im Auftrag von Johnson, Andrew N. via Core-talk
Gesendet: Donnerstag, 27. August 2020 01:17
An: EPICS core-talk <core-talk at aps.anl.gov>
Betreff: Opinions please, what should this database do

 

record(stringin, "si") {

  field(VAL, "This is a string")

}

record(lsi, "lsi") {

  field(SIZV, 80)

  field(INP, "si")

  field(PINI, YES)

}

record(aai, "aai") {

  field(NELM, 100)

  field(FTVL, CHAR)

  field(INP, "si")

  field(PINI, YES)

}

record(waveform, "wf") {

  field(NELM, 100)

  field(FTVL, CHAR)

  field(INP, "si")

  field(PINI, YES)

}

 

The lsi record's Soft Channel device support copies the string from the si record into the lsi.VAL field through its INP link. You can point an lsi link to either a DBF_STRING or an array of DBF_CHARs and it will handle either type.

 

Should the aai and waveform records also get copies of that string when they process?

 

Currently the aai.INP and wf.INP links read the si.VAL field and attempt to parse the string into an 8-bit integer, which they would then use to set the first element of their char arrays. The word “This” isn’t a valid integer, so the parsing fails and both arrays remain empty.

 

I am considering making changes to the type conversion routines that would make the aai and waveform device supports Do What I Mean in the above cases, at the risk of breaking some very obscure conversions between strings and arrays of char (but not arrays of UCHAR). There would probably be some similar changes in the other direction too.

 

Any objections? Comments?

 

- Andrew

 

-- 

Complexity comes for free, simplicity you have to work for.

 


Replies:
Re: Opinions please, what should this database do Johnson, Andrew N. via Core-talk
References:
Opinions please, what should this database do Johnson, Andrew N. via Core-talk

Navigate by Date:
Prev: WG: Opinions please, what should this database do Zimoch Dirk (PSI) via Core-talk
Next: Build failed: epics-base base-inspect-compiler-586 AppVeyor via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021 
Navigate by Thread:
Prev: WG: Opinions please, what should this database do Zimoch Dirk (PSI) via Core-talk
Next: Re: Opinions please, what should this database do Johnson, Andrew N. via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021