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  <20142015  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  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Fwd: Problem with creating an array of Long with aSub record
From: David Michel <[email protected]>
To: EPICS mailing list <[email protected]>
Date: Fri, 15 Aug 2014 12:41:25 +0100
Oops... please ignore my previous post... somehow pressed the send button by mistake.

===========

Hi All,

I was toying around with an aSub Record to get it to generate an array...

So I've got this code:

static long gen_array(aSubRecord *precord)
{
    long lx=1292;

    long arr[lx];
    long i=0;
    for (i=0;i<lx;i++)
    {
         arr[i] = i;
    }
    memcpy(precord->vala,arr,precord->nova*sizeof(long));

    return 0;
}

and this record:

record(aSub, "MyASubRecord") {
    field(SNAM, "gen_array")
    field(FTVA, "LONG")
    field(NOVA, "1292")
}


Given the value of lx, I would expect to see VALA with 0,1,2,3,4...1291

But I do a caget MyASubRecord.VALA, I get this:

MyASubRecord.VALA 1292 0 0 1 0 2 0 3 0 4... 644 0 645 0

The number of elements is correct, i.e. 1292, but there are 0s interlaced with the correct data ??? I'm sure it's something silly, but I cannot figure it out.


Thanks
David




Replies:
RE: Problem with creating an array of Long with aSub record michael.abbott
References:
Problem with creating an array of Long with aSub record David Michel

Navigate by Date:
Prev: Problem with creating an array of Long with aSub record David Michel
Next: RE: Problem with creating an array of Long with aSub record michael.abbott
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Problem with creating an array of Long with aSub record David Michel
Next: RE: Problem with creating an array of Long with aSub record michael.abbott
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 17 Dec 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·