Subject: |
stream protocol question: ASCII hex to 32-bit float |
From: |
Kevin Peterson <[email protected]> |
To: |
EPICS tech talk <[email protected]> |
Date: |
Thu, 10 Mar 2016 10:28:39 -0600 |
I have a helium sensor that responds to a query with this reply:
:80gv<VVVVVVVV><FFFFFFFF><CCCC><cr>
Where the non-constant parts of the response are ASCII hex characters
representing the following values:
<VVVVVVVV> = (32 bit floating point) The current gas value
<FFFFFFFF> = (32 bit unsigned integer) The sensor status
<CCCC> = (16 bit unsigned integer) The message checksum
Is there a straightforward way to parse the floating point value using
StreamDevice format converters?
The raw double converter %R doesn't work, presumably because it is
interpreting the ASCII chars as bytes, rather than hex values.
The value can be read as an int with %08X, but it isn't obvious how to
then cast that value as a float.
Thanks,
Kevin
--
Kevin M. Peterson
(630) 252-8644
[email protected]
- Replies:
- Re: stream protocol question: ASCII hex to 32-bit float Florian Feldbauer
- Re: stream protocol question: ASCII hex to 32-bit float Eric Norum
- Navigate by Date:
- Prev:
RE: mbbo/mbbi and bits subset Mark Rivers
- Next:
Re: stream protocol question: ASCII hex to 32-bit float Florian Feldbauer
- 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
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
RE: mbbo/mbbi and bits subset Mark Rivers
- Next:
Re: stream protocol question: ASCII hex to 32-bit float Florian Feldbauer
- 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
2021
2022
2023
2024
|