Experimental Physics and
| |||||||||||||||||
|
Hi,
my initial version used the connection listener to add monitor with native data type. But it didn't work.
Carsten
"Kasemir, Kay" <[email protected]> schrieb: Looks like you are asking for a DBRType.DOUBLE in the addMonitor, but the actual value (string) cannot be converted.
Ask for the 'native' value by adding a connection listener, then inside the connection listener do the addMonitor with the native data type. -Kay On Aug 21, 2013, at 5:44 AM, Carsten Winkler <[email protected]> wrote: > Hi all, > > it seems CAJ can't handle DBR_String. > If you request the value of a stringout or stringin EPICS variable you > always get a NullPointerException. > Also if you ask for the DESC field of any PV you'll get same error. > If you dig deeper you see the DBRType of the created channel is > UNKNOWN. Where comes this type come from? You find the problem in > "com.cosylab.epics.caj.CAJChannel.connectionCompleted(int sid, short > typeCode, int elementCount) ". This function gets the parameter > "typeCode" and the value of this parameter is "UNKNOWN" instead of > "STRING". But who sets the "typeCode"? The "typeCode" will be extracted > from the CA response header (AbstractCAResponseHandler) and here ends my > trace. > Did I miss something? Please check my source code and tell me what to do > to get strings. > > public class CAJBugTest { > public static void main(String[] args) throws Exception { > JCALibrary jca = JCALibrary.getInstance(); > Context ctxt = jca.createContext(JCALibrary.CHANNEL_ACCESS_JAVA); > Channel ch = ctxt.createChannel("INFOCL:scale.DESC"); > ch.addMonitor(DBRType.DOUBLE, 1, Monitor.VALUE, new > MonitorListener() { > @Override > public void monitorChanged(MonitorEvent ev) { > System.out.println(ev.getDBR().getValue()); > } > }); > ctxt.flushIO(); > Thread.sleep(5000); > ch.destroy(); > ctxt.destroy(); > } > } > > Cheers, > Carsten > > ________________________________ > > Helmholtz-Zentrum Berlin für Materialien und Energie GmbH > > Mitglied der Hermann von Helmholtz-Gemeinschaft Deutscher Forschungszentren e.V. > > Aufsichtsrat: Vorsitzender Prof. Dr. Dr. h.c. mult. Joachim Treusch, stv. Vorsitzende Dr. Beatrix Vierkorn-Rudolph > Geschäftsführung: Prof. Dr. Anke Rita Kaysser-Pyzalla, Thomas Frederking > > Sitz Berlin, AG Charlottenburg, 89 HRB 5583 > > Postadresse: > Hahn-Meitner-Platz 1 > D-14109 Berlin > > http://www.helmholtz-berlin.de > Helmholtz-Zentrum Berlin für Materialien und Energie GmbH Mitglied der Hermann von Helmholtz-Gemeinschaft Deutscher Forschungszentren e.V. Aufsichtsrat: Vorsitzender Prof. Dr. Dr. h.c. mult. Joachim Treusch, stv. Vorsitzende Dr. Beatrix Vierkorn-Rudolph Geschäftsführung: Prof. Dr. Anke Rita Kaysser-Pyzalla, Thomas Frederking Sitz Berlin, AG Charlottenburg, 89 HRB 5583 Postadresse: Hahn-Meitner-Platz 1 D-14109 Berlin http://www.helmholtz-berlin.de
| ||||||||||||||||
ANJ, 20 Apr 2015 |
·
Home
·
News
·
About
·
Base
·
Modules
·
Extensions
·
Distributions
·
Download
·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing · |