Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  Index 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020 
<== Date ==> <== Thread ==>

Subject: Re: Get sub field of Union
From: "Johnson, Andrew N. via Core-talk" <core-talk@aps.anl.gov>
To: "core-talk@aps.anl.gov" <core-talk@aps.anl.gov>
Date: Thu, 21 Mar 2019 22:00:28 +0000
Isn't the channel we were originally talking to a standard NTNDArray,
using the areaDetector plugin to serve an areaDetector NDArray over
PVAccess? That plugin uses pvDatabaseCPP IIUC.

- Andrew

On 3/21/19 4:10 PM, Shen, Guobao via Core-talk wrote:
> The union is what we are using for our fast DAQ data from FPGA.
> Our engineers designed the structure that format, and it has similar structure with AD image.
> We do not use a union containing a structure, which might complicate the system.
>
> In this case, you mean what I got is what I should expect. Right?
>
> On 3/21/19, 1:20 PM, "Michael Davidsaver" <mdavidsaver@gmail.com> wrote:
>
>     On 3/21/19 8:43 AM, Shen, Guobao via Core-talk wrote:
>     > Hi Core member,
>     > 
>     > Does anyone have experienced to read sub field of a Union structure?
>     
>     What you are showing looks like a discriminating/tagged union.
>     This is quite different to having a union containing a structure,
>     which is maybe what you expect?
>     
>     
>     > For example, I have a record:
>     > 
>     > $ pvinfo Test:Data
>     > 
>     > …
>     > 
>     > structure
>     > 
>     >     uint ArrayId
>     > 
>     >     double[] Time
>     > 
>     >     union value
>     > 
>     >         float[] data1
>     > 
>     >         double[] data2
>     > 
>     >  
>     > 
>     > If I use
>     > 
>     > $ pvget -r value Test:Data
>     > 
>     > Test:Data
>     > 
>     > structure
>     > 
>     >     union value
>     > 
>     >         float[]  [-0.034794,-0.0417011, …]
>     > 
>     >  
>     > 
>     > But if I do it with:
>     > 
>     > $ pvget -r value.data1 Test:Data
>     > 
>     >  
>     > 
>     > I got an error on my client like
>     > 
>     > [Test: Data] failed to create channel get: Status [type=FATAL, message=std::bad_alloc]
>     > 
>     >  
>     > 
>     > Is that a right way to use it for union?
>     > 
>     >  
>     > 
>     > Thanks,
>     > 
>     > Guobao
>     > 
>     
>     
>

-- 
Arguing for surveillance because you have nothing to hide is no
different than making the claim, "I don't care about freedom of
speech because I have nothing to say." -- Edward Snowdon


References:
Get sub field of Union Shen, Guobao via Core-talk
Re: Get sub field of Union Michael Davidsaver via Core-talk
Re: Get sub field of Union Shen, Guobao via Core-talk

Navigate by Date:
Prev: Re: Get sub field of Union Shen, Guobao via Core-talk
Next: Re: Get sub field of Union Michael Davidsaver via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020 
Navigate by Thread:
Prev: Re: Get sub field of Union Shen, Guobao via Core-talk
Next: Re: Get sub field of Union Michael Davidsaver via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020 
ANJ, 21 Mar 2019 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·