EPICS Home

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: stream protocol question: ASCII hex to 32-bit float
From: Kevin Peterson <[email protected]>
To: Florian Feldbauer <[email protected]>, EPICS tech talk <[email protected]>
Date: Fri, 11 Mar 2016 15:09:08 -0600
Thanks.  I had hoped to avoid using the subroutine record, but that is
pretty simple and maintainable.

Kevin

On 3/10/16 10:39 AM, Florian Feldbauer wrote:
> Hey Kevin,
> 
> I had the same problem once with a HV power supply.
> I solved the problem this way:
> 
> - Read the value via StreamDevice into a longin record
> - Use a sub-record to convert 32bit-int to 32bit-float
> 
> The subroutine is quiet easy:
> 
> union ficonv{
>   float float_val;
>   unsigned int  int_val;
> };
> 
> static long intToFloat(subRecord *prec) {
>   union ficonv myconf;
> myconf.int_val = prec->a;
> prec->b = myconf.float_val;
> return 0;
> }
> 
> I hope this helps!
> 
> Cheers
> Florian
> 


References:
stream protocol question: ASCII hex to 32-bit float Kevin Peterson
Re: stream protocol question: ASCII hex to 32-bit float Florian Feldbauer

Navigate by Date:
Prev: Re: stream protocol question: ASCII hex to 32-bit float Kevin Peterson
Next: Re: EPICS Archiver Appliance web interface error Shankar, Murali
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: stream protocol question: ASCII hex to 32-bit float Florian Feldbauer
Next: Re: stream protocol question: ASCII hex to 32-bit float 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