Experimental Physics and Industrial Control System
Hi,
I'm attempting to use an asub to read an array of
strings from a waveform record with Epics 3.14.11
The strings are written to the waveform with a 'caput -a' e.g.
caput -a test:evt:WF6:ETA 4 "alas" "poor" "yorik" "Iknewhimhoratio"
Old : test:evt:WF6:ETA 10
New : test:evt:WF6:ETA 10 alas poor yorik Iknewhimhoratio
NORD and VAL of the waveform record are linked to INPB and
INPC of the asub, respectively.
The forward link of the waveform triggers the asub to process
and the subroutine tries to read an array of strings like so ...
void loadETA(aSubRecord * asub)
{
int etaLen = *(short*)(asub->b);
char** etaIn = (char**)(asub->c);
for (int i = 0; i < etaLen; ++i)
printf("\t%s\n", *(etaIn++));
}
The IOC terminates with a SEGV when the subroutine runs.
A call to printf("%s\n", (char*)(asub->c));
prints the first string in the array, whereas I would have expected
asub->c to hold the address of the first string in the array.
I've been able to read an array of doubles from the waveform
with a subroutine similar to the above, but I'm stuck with the
strings. Perhaps I'm doing something obviously wrong ?
Any help greatly appreciated.
Thanks-In-Advance,
--
Regards, Simon.
*================================================================*
| | + |
| Simon Hoyle | + + |
| Software Engineer \===O + |
| CSIRO ATNF Parkes Observatory /[] | + |
| P.O. Box 276 Ph. (02) 6861 1700 |HHH\| |
| Parkes NSW 2870 FAX (02) 6861 1730 |OHO| \__ |
| AUSTRALIA [email protected] |HHH| |
| """""""""""" |
*================================================================*
- Replies:
- Re: Reading an array of strings from a Waveform record Andrew Johnson
- Navigate by Date:
- Prev:
Re: EPICS database comparison John Faucett
- Next:
Re: Any News on EPICS 3.14.11 with vxWorks 6.7 Ernest L. Williams Jr.
- 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: EPICS database comparison John Faucett
- Next:
Re: Reading an array of strings from a Waveform record Andrew Johnson
- 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