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  <20152016  2017  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  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Passing a raw byte value from st.cmd to a StreamDevice proto file
From: Andrew Johnson <[email protected]>
To: Michael Ritzert <[email protected]>, EPICS Tech-Talk <[email protected]>
Date: Thu, 30 Jul 2015 17:26:57 -0500
Hi Michael,

On 07/29/2015 07:52 AM, Michael Ritzert wrote:
> I'm looking for a way to pass a raw byte parameter from st.cmd through the
> database to the format string in a StreamDevice proto file. I investigated both
> passing a binary value through dbLoadRecords, but the obvious options \x24 or
> \044 (e.g. dbLoadRecords("gf100.db","PORT=L0,ADDR=0,MAC=\x24")) do not work as
> I had hoped (the \ is swallowed, the rest is taken verbose). I also tried to
> have the string interpreted as a number in the proto file by putting it into a
> formatting statement as if \$1 was another record name. All this got me was
> error messages.
> 
> Does anybody have a suggestion?

Have you tried doubling-up on the back-slash character in your macro
string? The IOC does translate escaped characters into their raw form
when loading field value strings from a .db file, but that translation
only takes place at the last stage of interpretation. Your macro string
goes through more than one level of unescaping between the st.cmd file
and the record field itself, so I think you should try using 2 or more
back-slash characters instead of just one, e.g.
	dbLoadRecords("gf100.db","PORT=L0,ADDR=0,MAC=\\x24")
or
	dbLoadRecords("gf100.db","PORT=L0,ADDR=0,MAC=\\\x24")

EPICS understands these standard C escapes:
	\a \b \f \n \r \t \v \\ \? \' \"
	\ooo where o is an octal digit
	\xHH where H is a hex digit

HTH,

- Andrew

-- 
Light thinks it travels faster than anything but it is wrong.
No matter how fast light travels, it finds the darkness has
always got there first, and is waiting for it.
    -- Terry Pratchett, Reaper Man

Replies:
Re: Passing a raw byte value from st.cmd to a StreamDevice proto file Michael Ritzert
References:
Passing a raw byte value from st.cmd to a StreamDevice proto file Michael Ritzert

Navigate by Date:
Prev: Re: Jeorger enterprises Mark Rivers
Next: Re: Passing a raw byte value from st.cmd to a StreamDevice proto file Michael Ritzert
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Passing a raw byte value from st.cmd to a StreamDevice proto file Michael Ritzert
Next: Re: Passing a raw byte value from st.cmd to a StreamDevice proto file Michael Ritzert
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 16 Dec 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·