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 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
<== Date ==> <== Thread ==>

Subject: RE: NTNDArrays, Java
From: "Madden, Timothy J." <tmadden@aps.anl.gov>
To: "Rivers, Mark L." <rivers@cars.uchicago.edu>, "'bob dalesio'" <bob.dalesio@gmail.com>, Marty Kraimer ‎[mrkraimer@comcast.net]‎ <mrkraimer@comcast.net>, Stefan <weiher@fhi-berlin.mpg.de>, Heinz Junkes <junkes@fhi-berlin.mpg.de>
Cc: EPICS tech-talk <tech-talk@aps.anl.gov>
Date: Mon, 13 Mar 2017 17:47:24 +0000
Folks

I posted my source code with some comments at
https://github.com/argonnexraydetector/MaddenNTNDArrayJavaClient/blob/master/src/epicsv4test/imageget.java


I can get the data, but it does not show up as a real NTNDArray, only the fields I ask for. If I ask for whole NTNDArray on the createMonitor command,
I crash the host IOC that hosts the PV.

I started this on late Nov as Mark said, then got really busy and forgot about it. I am getting back to it.
The PvaDriver source code seems to request the default settings when monitor is started. I understand default is not complete NTNDArray, but value, timestamp,
and something else that I can't remember. I am probably confused on this.
I can call pvinfo, pvget from the command line and see the NTNDArray. pvget only gets some fields, unless you request them.
Not sure how to request the entire normative type on pvget.

T



From: Mark Rivers [rivers@cars.uchicago.edu]
Sent: Friday, March 10, 2017 11:42 AM
To: Madden, Timothy J.; 'bob dalesio'
Cc: EPICS tech-talk
Subject: RE: NTNDArrays, Java

Ø  I think I need just monitor the uniqueID, and when it changes, then I can do a full get of the ntndarray.

 

That is how the existing Channel Access client used to work.  However, it was recently changed to monitor ArrayCounter_RBV rather than UniqueId.  The reason is that areaDetector now supports processing plugins again without waiting for a new NDArray to arrive.  In that case the UniqueId will not change, so ImageJ would not display the new array.  The ArrayCounter_RBV field in the NDPluginStdArrays (Channel Access) or NDPluginPva (pvAccess) will always increment, so you could monitor that instead. 

 

However, this approach will make your code specific to that areaDetector plugin since that PV is not part of the NTNDArray structure.  Thus your ImageJ plugin would not work with other PV access servers sending NTNDArrays. I would be surprised if you cannot monitor the entire NTNDArray rather than having to monitor something else and then do a get.  It seems to work fine in the pvaDriver.cpp C++ code.  I suggest you try to make that original approach work.

 

Mark

 

 

From: Madden, Timothy J. [mailto:tmadden@aps.anl.gov]
Sent: Friday, March 10, 2017 11:25 AM
To: Mark Rivers; 'bob dalesio'
Cc: EPICS tech-talk
Subject: RE: NTNDArrays, Java

 

folks
Thanks for the email.

I think I am tracking this down.
The default monitor will only monitor value and timestamp, and not even get all the fields.
Then when I monitor, waitEvent then getData, it only gets a few of the fields. that is why I cannot see the whole NTNDArray

I think I need just monitor the uniqueID, and when it changes, then I can do a full get of the ntndarray.

I will post again.

Tim




From: Mark Rivers [rivers@cars.uchicago.edu]
Sent: Friday, March 10, 2017 11:22 AM
To: 'bob dalesio'; Madden, Timothy J.
Cc: EPICS tech-talk
Subject: RE: NTNDArrays, Java

He is correctly connected to the NDPluginPva server.

 

From: tech-talk-bounces@aps.anl.gov [mailto:tech-talk-bounces@aps.anl.gov] On Behalf Of bob dalesio
Sent: Friday, March 10, 2017 11:10 AM
To: Madden, Timothy J.
Cc: EPICS tech-talk
Subject: Re: NTNDArrays, Java

 

Are you connected to the area detector server or the waveform record?

We are now working on making records put in the metadata.

Bob

 

On Mar 10, 2017 11:16 AM, "Madden, Timothy J." <tmadden@aps.anl.gov> wrote:

I am playing with NTNDArrays. I generate them from AD 2-5 with a sim detector and the pva plugin.
pvget can display the arrays that pop out of the driver.

Now I am writing a java program to monitor and eventually display in Image J.

The code is below.

I problem I have is that the dimensions and uniqie ID seem to be abscent from the data.
Also, calling NTNDArray.wrap fails, as the returned data seems to be not a real NT ND Array.

Furtner, the image data is byte[] type. I can get out the Union or values, or call toString to get the raw data.
I am not sure how  Java figures out if the union is bytes or ints or whatever.
I will have to be able to ask the NTNDArray what its datatype is, then convert to ints or whatever the datatype is. Not sure how this is done.
I have looked at the C++ code for the PVA ADDriver in AD2-5, but there are differences between cpp and java interfaces.
Also I have to call wrapUnsafe to even convert  the PVStructure into NTNDArray, which makes no sense. wrap fails.



Thanks
Tim Madden

Code below:


    public static void main(String[] args) {
        // TODO Auto-generated method stub

        System.out.println("Maddens test java get image");
        if (true)
        {
        PvaClient pva=PvaClient.get();
        PvaClientChannel mychannel = pva.channel("13SIM1:Pva1:Image");
       
       
        PvaClientMonitor pvamon=mychannel.monitor();
        //pvamon.connect();
        pvamon.start();
       
        PvaClientMonitorData easydata = pvamon.getData();
       
       
        while(true)
        {
        pvamon.waitEvent(0);
       
        //String sc = easydata.showChanged();
        PVStructure pvs = easydata.getPVStructure();
       
       
        NTNDArray myarray =NTNDArray.wrapUnsafe(pvs);
        //String imgstr = myarray.toString();
           
        PVUnion pvu = myarray.getValue();
       
        PVStructureArray dims = myarray.getDimension();
       
        //org.epics.pvdata.pv.Field a = pvu.getField();
        //PVInt uniqid = myarray.getUniqueId();
       
       
        //PVStructureArray psa =myarray.getAttribute();
   
        System.out.println("got data ");

        pvamon.releaseEvent();
       
        }
   
        }
   
       
        System.out.println("Maddens test java end");

    }


Replies:
Re: NTNDArrays, Java Kasemir, Kay
References:
NTNDArrays, Java Madden, Timothy J.
Re: NTNDArrays, Java bob dalesio
RE: NTNDArrays, Java Mark Rivers
RE: NTNDArrays, Java Madden, Timothy J.
RE: NTNDArrays, Java Mark Rivers

Navigate by Date:
Prev: Re: CaQtDM installation error on scientific linux 7.2 Matt Newville
Next: Re: NTNDArrays, Java Kasemir, Kay
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
Navigate by Thread:
Prev: RE: NTNDArrays, Java Mark Rivers
Next: Re: NTNDArrays, Java Kasemir, Kay
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
ANJ, 13 Mar 2017 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·