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  2016  2017  2018  2019  2020  <20212022  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  2016  2017  2018  2019  2020  <20212022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Fwd: StreamDevice Format Converters
From: "Zimoch Dirk \(PSI\) via Tech-talk" <tech-talk at aps.anl.gov>
To: EPICS tech-talk <Tech-talk at aps.anl.gov>
Date: Sun, 14 Nov 2021 13:15:44 +0000
I had accidentally dent this to the wrong address…

Von: "Zimoch Dirk (PSI)" <dirk.zimoch at psi.ch>
Datum: 12. November 2021 um 11:29:00 MEZ
An: Donny Domagoj Cosic <Donny.Domagoj.Cosic at irb.hr>
Kopie: Tech-talk <tech-talk-bounces at aps.anl.gov>
Betreff: AW: StreamDevice Format Converters

You get the number as a 0 padded decimal integer. Thus use %d. The value 245 will end up un RVAL. Let the ai convert the value for you to 2.45 by setting ESLO to 0.01. Set LINR to LINEAR or SLOPE.

The %= format is meant to check if a readback contains the expected value. It can appear in an 'in' command but behaves like an output format. What it does is: Did I read the same string I would get if I printed the current value with this format? It does not set anything in the record but may cause a parse error if the string does not match the expectation. Useful in output records when the device sends back the written value and you want to check if the device understood the correct thing.

-----Ursprüngliche Nachricht-----
Von: Tech-talk <tech-talk-bounces at aps.anl.gov> Im Auftrag von
Donny Domagoj Cosic via Tech-talk
Gesendet: Freitag, 12. November 2021 11:18
An: Ralph Lange via Tech-talk <tech-talk at aps.anl.gov>
Betreff: StreamDevice Format Converters

Hi,

I receive a string from a device containing the current draw as a 6
character number. ie. for 2.45 A, the string would be 000245. Using the
format converter %6f in the proto file, I am able to read the value into
a ai record as 245. However when I try to convert the input string using
%=6.2f, I always read in 0 as the current.

Am I understanding the = operator properly? How can I convert the string
000245 input into 2.45 in the ai record?

Thank you in advance,

--
Donny Domagoj Cosic

Laboratory for Ion Beam Interactions
Ruđer Bošković Institute
Bijenička cesta 54 | HR-10 000 Zagreb | CROATIA
T: +385 1 4561 041 | @: dcosic at irb.hr | www.irb.hr

References:
StreamDevice Format Converters Donny Domagoj Cosic via Tech-talk

Navigate by Date:
Prev: Re: StreamDevice Format Converters Ralph Lange via Tech-talk
Next: R3-3 of ADSpinnaker Mark L Rivers 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  2019  2020  <20212022  2023  2024 
Navigate by Thread:
Prev: Re: StreamDevice Format Converters Ralph Lange via Tech-talk
Next: Re: StreamDevice Format Converters Donny Domagoj Cosic 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  2019  2020  <20212022  2023  2024 
ANJ, 15 Nov 2021 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·