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  2014  2015  2016  2017  2018  <20192020  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  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: 2D waveform records
From: "Johnson, Andrew N. via Tech-talk" <[email protected]>
To: "Sobhani, Bayan" <[email protected]>, "[email protected]" <[email protected]>
Date: Thu, 14 Feb 2019 17:48:32 +0000
Hi Alex,

On 2/13/19 11:13 AM, Sobhani, Bayan via Tech-talk wrote:

Is it possible to have 2D waveform in EPICS? I have a waveform PV called ScanResults with type “DBR_DOUBLE[4]”. Would it be possible for it to have a type “DBR_DOUBLE[2][2]”? I notice the asynPortDriver::readFloat64Array function has a field for nElements but does not seem to have a field for dimensions.

 

Alex

The IOC can only handle 1-D arrays, but it doesn't really know/care about the layout of the double values within the 1-D array, so provided everything that accesses the waveform's VAL field agrees how what the array dimensions are meant to be you can treat the array as 2-D or higher if you want. Mark Rivers' AreaDetector modules do this and can support any number of array dimensions, although I'm not implying that you have to use AreaDetector.

The C language spec defines the memory layout for multi-dimensional arrays, e.g. see
    https://docs.microsoft.com/en-us/cpp/c-language/multidimensional-arrays-c?view=vs-2017
Note that this works even between different CPU architectures as long as you're always reading/storing values of the correct type (in your case double). Channel Access will perform any necessary byte-order changes when transporting the 1-D array values if your client and server have different endianness.

HTH,

- Andrew
-- 
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:
2D waveform records Sobhani, Bayan via Tech-talk

Navigate by Date:
Prev: RE: How to detect AsynIPPort disconnect? Mark Rivers via Tech-talk
Next: FW: 2D waveform records Mark Rivers via Tech-talk
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  <20192020  2021  2022  2023  2024 
Navigate by Thread:
Prev: 2D waveform records Sobhani, Bayan via Tech-talk
Next: FW: 2D waveform records Mark Rivers via Tech-talk
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  <20192020  2021  2022  2023  2024 
ANJ, 14 Feb 2019 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·