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  <20122013  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  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: How to get array of strings from waveform record?
From: Andrew Johnson <[email protected]>
To: [email protected], [email protected]
Date: Tue, 14 Feb 2012 12:34:20 -0600
Hi Nerses,

On 2012-02-14 Nerses Gevorgyan wrote:
> 
> I'm trying to put into waveform record an array of STRINGs.
> 
> As I understood from waveform code and manual the VAL field is
> a void pointer which should be supplied by user.

Sorry, if that's what the record reference manual says it's wrong.

The prec->val field is never actually used inside the record source code.  
When you the access the VAL field of a waveform record through CA or a 
database link, the data is actually fetched from the prec->bptr field, which 
gets initialized in the first pass of record initialization to a point to a 
buffer that holds NELM values of the type FTVL.  Device support should copy 
its data into this buffer, never modify the prec->bptr field itself.

> For a case of array of STRINGs it could have different organizations. Like:
> 1) elements delimited by NULLes
>      aaa\0bbbbbb\0cc\0...
> 2) each element of array has a fixed length chars and the names then
> padded with NULL-es like below
>      aaa\0\0\0\0\0\0\0bbbbbb\0\0\0\0cc\0\0\0\0\0\0\0\0

When FTVL=STRING the array elements are all MAX_STRING_SIZE=40 characters 
long, thus when NELM=2 the buffer is 80 bytes long and the second string 
element starts at offset 40 into the buffer.

Hope this helps,

- Andrew
-- 
Optimization is the process of taking something that works and
replacing it with something that almost works, but costs less.
-- Roger Needham

Replies:
Re: How to get array of strings from waveform record? Benjamin Franksen
Re: How to get array of strings from waveform record? Nerses Gevorgyan
References:
How to get array of strings from waveform record? Nerses Gevorgyan

Navigate by Date:
Prev: How to get array of strings from waveform record? Nerses Gevorgyan
Next: Re: How to get array of strings from waveform record? Benjamin Franksen
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: How to get array of strings from waveform record? Nerses Gevorgyan
Next: Re: How to get array of strings from waveform record? Benjamin Franksen
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 18 Nov 2013 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·