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 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 2017 2018 2019 2020 2021 2022 2023 2024 |
<== Date ==> | <== Thread ==> |
---|
Subject: | using the JCA extension |
From: | Sharon Lackey <[email protected]> |
To: | [email protected] |
Date: | Wed, 29 Mar 2006 11:24:45 -0600 |
I am trying to use the JCA extension from the binary
download. I have tried it on windows and on Fermi Scientific Linux
and get the same result. I’m using the example Java program
to connect to a channel from the virtual linac IOC. The channel connects
without error but when I read the value it is unintelligible. Here is
what I’m doing in Java… try { JCALibrary jca=
JCALibrary.getInstance(); Context ctxt=
jca.createContext(JCALibrary.JNI_SINGLE_THREADED);
ctxt.printInfo(); // Create the
Channel to connect to the PV. Channel ch=
ctxt.createChannel("win32:CM1:intensityM");
// send the request and wait 5.0 seconds for the channel to connect to the PV. try{
ctxt.pendIO(5.0);} catch(Exception
ex){
System.out.println(ex.getMessage()); }
// If we're here, then everything went fine.
// Display basic information about the channel. DBR reading =
ch.get(); System.out.println("getValue="+reading.getValue());
System.out.println(ch.getElementCount());
System.out.println("type="+ch.get().getType());
System.out.println(ch.get().getValue()); ch.printInfo(); // We have
no clue on whether the channel has been found and connected. // until the
connection callback is called. //
System.out.println("intensityM = "+ch.get().getValue()); ch.destroy(); ctxt.destroy(); } catch(CAException caEx) {
System.err.println("A Error occured: "+caEx); } And here is the output…. CLASS : gov.aps.jca.jni.SingleThreadedContext PREEMPTIVE_CALLBACK : true ADDR_LIST : AUTO_ADDR_LIST : true CONNECTION_TIMEOUT : 30.0 BEACON_PERIOD : 15.0 REPEATER_PORT : 5065 SERVER_PORT : 5064 MAX_ARRAY_BYTES : 16384 EVENT_DISPATCHER: gov.aps.jca.event.DirectEventDispatcher@19b49e6 getValue=[D@14a9972 1 type=gov.aps.jca.dbr.DBRType[DBR_DOUBLE=6] [D@a01335 CHANNEL : win32:CM1:intensityM TYPE :
gov.aps.jca.dbr.DBRType[DBR_DOUBLE=6] COUNT : 1 STATE :
gov.aps.jca.Channel$ConnectionState[CONNECTED=2] HOSTNAME : juno.fnal.gov:5064 READ : true WRITE : true intensityM = [D@14d3343 Anyone know what I’m doing wrong??? Thanks, Sharon Lackey |