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  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: genSub
From: Matthieu Bec <[email protected]>
To: "Szalata, Zenon M." <[email protected]>
Cc: EPICS Techtalk <[email protected]>
Date: Wed, 12 Mar 2008 16:53:25 -0300
Hi Zenon,

it sounds like you have a char array, but want to parse a string in the gensub: memset(0,) will do that but you could also check your output is \0 terminated.

Matthieu


Szalata, Zenon M. wrote:
In my soft IOC a waveform record reads a string of numeric data from an instrument in ASCII format separated by ','.  This string varies in length from one reading to the next.  I use genSub to convert the ASCII data to floating point data.  I bring the ASCII data into genSub via INPA, for which I set FTA="CHAR".
I discovered that if a shorter string follows a longer string, in INPA the new string data is followed by the remainder of the previous string!  I fixed that by using memset() function after the string was converted.  Is this a design behavior of genSub? Is there a better way to get rid of leftover data from previous read than I am doing?

My IOC is coded with asyn and streamdevice.  I suppose I should look at how to use stream device to convert the data.  I use genSub not only to convert the data but also to scale the data and correct for an offset, both of these are read from the instrument, prior to reading the waveform data.
Thanks,

Zen



--
Matthieu Bec              Gemini Observatory
Tel: +56 51 205785        c/o AURA, Casilla 603
Fax: +56 51 205650        La Serena, Chile

References:
genSub Szalata, Zenon M.

Navigate by Date:
Prev: RE: [APS Beamline_controls] EPICS support for 2-D detectors/cameras Mark Rivers
Next: genSub Szalata, Zenon M.
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: genSub Szalata, Zenon M.
Next: Re: genSub Andy Foster
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 02 Sep 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·