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  2016  2017  2018  <20192020  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  <20192020 
<== Date ==> <== Thread ==>

Subject: Re: Stream device character parse
From: Dr. Bastian Löher via Tech-talk <tech-talk@aps.anl.gov>
To: 吴煊 <wux@ihep.ac.cn>
Cc: tech-talk <tech-talk@aps.anl.gov>
Date: Thu, 11 Apr 2019 14:07:22 +0200
Hi Xuan,

I'd parse both pieces separately into different records, i.e.
pressure_val and pressure_exp using redirection to fields:

in = "%(pressure_val)d%(pressure_exp)d"

I think, the - or + are parsed automatically into the pressure_exp, 
then.

Then you'd need a calc record to combine those two values back into 
a float value.

It is also possible to use a regex substitution converter to go from 
e.g. '86+3' to '86e+3' and then use a regular %f.


Kind regards

Bastian

On 190411-1531, 吴煊 via Tech-talk wrote:
> Hi all,
> 
> I use stream device to get vaccum degree, the response is like 86+3, means 8.6*10^3; 86-5, means 8.6*10^-5. What is the best way to get the value by using protocol or record?
> 
> Thanks,
> 
> Xuan

-- 
Dr. Bastian Löher

Data acquisition
Experiment controls
Detector development

R3B - Relativistic reactions with radioactive beams
Gamma spectroscopy


-- TU Darmstadt ---------------------------------------------------------------

Room / Raum: S2|14 418
Phone / Telefon: +49 6151 23532
Mobile / Mobil: +49 162 5467038
E-Mail: loeher@ikp.tu-darmstadt.de

Institut für Kernphysik
Technische Universität Darmstadt
Schlossgartenstrasse 9, 64289 Darmstadt
http://www.ikp.tu-darmstadt.de


-- GSI ------------------------------------------------------------------------

Room / Raum: SB3 3.199
Phone / Telefon: +49 6159 71 2739, 3272
Fax: +49 6159 71 3007
Mobile / Mobil: +49 162 5467038
E-Mail: b.loeher@gsi.de

GSI Helmholtzzentrum für Schwerionenforschung GmbH
Planckstraße 1, 64291 Darmstadt, Germany, www.gsi.de

Commercial Register / Handelsregister: Amtsgericht Darmstadt, HRB 1528
Managing Directors / Geschäftsführung:
Professor Dr. Paolo Giubellino, Ursula Weyrich, Jörg Blaurock
Chairman of the Supervisory Board / Vorsitzender des GSI-Aufsichtsrats:
State Secretary / Staatssekretär Dr. Georg Schütte

References:
Stream device character parse 吴煊 via Tech-talk

Navigate by Date:
Prev: Re: Support for Emerson Unidrive SP? Goetz Pfeiffer via Tech-talk
Next: Re: Stream device character parse Dirk Zimoch via Tech-talk
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  <20192020 
Navigate by Thread:
Prev: Stream device character parse 吴煊 via Tech-talk
Next: Re: Stream device character parse Dirk Zimoch via Tech-talk
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  <20192020 
ANJ, 11 Apr 2019 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·