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: CAJ can't handle DBR_String
From: Carsten Winkler <[email protected]>
To: tech-talk <[email protected]>
Date: Wed, 21 Aug 2013 11:44:29 +0200
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:
Re: CAJ can't handle DBR_String Kasemir, Kay

Navigate by Date:
Prev: EPICS Qt Framework Ricardo Fernandes
Next: CSS DataBrowser/Trend : legend font Takashi OBINA
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: EPICS Qt Framework Ricardo Fernandes
Next: Re: CAJ can't handle DBR_String Kasemir, Kay
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 ·