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  <20132014  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  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: CAJ can't handle DBR_String
From: "Kasemir, Kay" <[email protected]>
To: Carsten Winkler <[email protected]>
Cc: "[email protected]" <[email protected]>
Date: Wed, 21 Aug 2013 09:24:06 -0400
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
> 



Replies:
AW: CAJ can't handle DBR_String Winkler, Carsten
References:
CAJ can't handle DBR_String Carsten Winkler

Navigate by Date:
Prev: CSS DataBrowser/Trend : legend font Takashi OBINA
Next: AW: CAJ can't handle DBR_String Winkler, Carsten
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: CAJ can't handle DBR_String Carsten Winkler
Next: AW: CAJ can't handle DBR_String Winkler, Carsten
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 20 Apr 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·