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