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  <20172018  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  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: NTNDArrays, Java
From: Mark Rivers <[email protected]>
To: "'bob dalesio'" <[email protected]>, "Madden, Timothy J." <[email protected]>
Cc: EPICS tech-talk <[email protected]>
Date: Fri, 10 Mar 2017 17:22:30 +0000

He is correctly connected to the NDPluginPva server.

 

From: [email protected] [mailto:[email protected]] 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." <[email protected]> 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 Madden, Timothy J.
References:
NTNDArrays, Java Madden, Timothy J.
Re: NTNDArrays, Java bob dalesio

Navigate by Date:
Prev: Re: NTNDArrays, Java bob dalesio
Next: RE: NTNDArrays, Java Madden, Timothy J.
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: NTNDArrays, Java bob dalesio
Next: RE: NTNDArrays, Java Madden, Timothy J.
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024 
ANJ, 21 Dec 2017 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·